Skip to content

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

Merged
merged 4 commits into from
Jun 15, 2021

Conversation

caberos
Copy link
Contributor

@caberos caberos commented May 27, 2021

Copy link
Contributor

@FernandoOjeda FernandoOjeda left a 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.

Copy link
Member

@allmightyspiff allmightyspiff left a 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")

Copy link
Member

@allmightyspiff allmightyspiff left a 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.

Copy link
Contributor

@FernandoOjeda FernandoOjeda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Copy link
Contributor

@ATGE ATGE left a 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.

@allmightyspiff allmightyspiff merged commit 275fc96 into softlayer:master Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

slcli vlan cancel should report if a vlan is automatic
4 participants