-
Notifications
You must be signed in to change notification settings - Fork 192
slcli vlan cancel should report if a vlan is automatic #1495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not forget to add unit test for the new methods implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the logic of CLI/vlan/cancel.py to something like this:
reasons = mgr.get_cancel_failure_reasons(identifier)
if len(reasons) > 0:
raise exceptions.CliAbort(reasons )
item = mgr.get_vlan(identifier).get('billingItem')
if item:
billing.cancel_item(item.get('id'), 'cancel by cli command')
else:
raise exceptions.CliAbort("VLAN is an automatically assigned and free of charge VLAN, it will automatically be removed from your account when it is empty")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing
- ✔️slcli vlan cancel 1234556
- ✔️slcli -v -y vlan cancel 1234556
- ✔️slcli vlan cancel -h'
-✔️ slcli vlan -h
looks good, just a comment on cancel cli method docs.
#1489