Skip to content

Commit

Permalink
fix(networks): delete in use network
Browse files Browse the repository at this point in the history
  • Loading branch information
smrutisenapati authored and pallabpain committed Sep 4, 2024
1 parent 313c660 commit a9d2c49
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions riocli/network/delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ def delete_network(
workers=workers, key=lambda x: x[0]
)
data, statuses = [], []
for name, status in result:
for name, status, msg in result:
fg = Colors.GREEN if status else Colors.RED
icon = Symbols.SUCCESS if status else Symbols.ERROR

statuses.append(status)
data.append([
click.style(name, fg),
click.style(icon, fg)
click.style('{} {}'.format(icon, msg), fg)
])

with spinner.hidden():
Expand All @@ -117,7 +117,7 @@ def delete_network(
def _apply_delete(client: Client, result: Queue, network: Network) -> None:
try:
client.delete_network(network_name=network.metadata.name)
result.put((network.metadata.name, True))
result.put((network.metadata.name, True, 'Network Deleted Successfully'))
except Exception as e:
click.secho()
result.put((network.metadata.name, False))
result.put((network.metadata.name, False, str(e)))

0 comments on commit a9d2c49

Please sign in to comment.