-
Notifications
You must be signed in to change notification settings - Fork 194
updating the virt cli create and create-options commands #864
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
…ted hosts and flavors correct sorting, removing need to methods to add cpus and flavors rows
2ffec97
to
73c19c1
Compare
required = [hostname, domain] | ||
|
||
flavor = kwargs.get('flavor', None) | ||
host_id = kwargs.get('host_id', None) |
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.
Is it ok if flavor
is provided, but host_id
is also given? host_id
doesn't require dedicated
, so it won't hit the exclusive check.
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.
host_id should not be provided with flavor. I'll update to prevent that.
SoftLayer/managers/vs.py
Outdated
'id,nextInvoiceTotalRecurringAmount,' | ||
'children[categoryCode,nextInvoiceTotalRecurringAmount],' | ||
'orderItem.order.userRecord[username]' | ||
'orderItem[id,order.userRecord[username],preset.keyName]' |
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.
The billingItem
mask could be made into a multiline string for readability.
raise exceptions.ArgumentError( | ||
'[-m | --memory] not allowed with [-f | --flavor]') | ||
|
||
if all([args['dedicated'], args['flavor']]): |
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.
You could also include one for host-id
and flavor
right?
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.
Yep. Adding.
SoftLayer/CLI/virt/create_options.py
Outdated
cpus = [] | ||
for cpu_option in cpu_options: | ||
cpus.append(str(cpu_option['template']['startCpus'])) | ||
bal_flavors = [str(x['flavor']['keyName']) for x in result['flavors'] |
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.
You could put flavor extraction into a separate method and generalize it to avoid duplication here.
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.
+1 seems like a lot of duplication in this area
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.
Will do.
…in create-options, misc code review update
The virtual create-options command was updated to show flavors and the dedicated host options. The virtual create command was updated to accept a flavor key and a host id.
This pull request is dependent on some minor updates to the SoftLayer API. DO NOT MERGE. Myself, @sergiocarlosmorales, or @camporter will handle merging this one at the appropriate time.