Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions networkapi/api_interface/facade.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,8 @@ def generate_and_deploy_channel_config_sync(user, id_channel):
raise exceptions.InvalidIdInterfaceException()

channel = PortChannel.get_by_pk(id_channel)
channel.status_deploy = StatusDeploy.processing[0]
channel.save(user)

interfaces = channel.list_interfaces()

Expand Down
3 changes: 2 additions & 1 deletion networkapi/interface/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,10 @@ def get_by_name(cls, name):

class StatusDeploy:
pending = ('pending', 'pending')
processing = ('processing', 'processing')
deployed = ('deployed', 'deployed')
error = ('error', 'error')
list_type = (pending, deployed, error)
list_type = (pending, processing, deployed, error)


class PortChannel(BaseModel):
Expand Down
4 changes: 4 additions & 0 deletions networkapi/interface/resource/InterfaceChannelResource.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,10 @@ def handle_delete(self, request, user, *args, **kwargs):

# For each equipment (leaf), undeploy port channel config
try:
if keep_db:
channel.status_deploy = StatusDeploy.processing[0]
channel.save(user, commit=True)

for e in equip_dict:
if not keep_db:
for i in equip_dict.get(e):
Expand Down
Loading