Skip to content

Conversation

kwienken
Copy link
Contributor

@kwienken kwienken commented Aug 23, 2017

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.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.04%) to 85.106% when pulling 2ffec97 on kwienken:vs-create-updates into 5c3e6ae on softlayer:master.

…ted hosts and flavors

correct sorting, removing need to methods to add cpus and flavors rows
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.06%) to 85.089% when pulling 73c19c1 on kwienken:vs-create-updates into 5c3e6ae on softlayer:master.

required = [hostname, domain]

flavor = kwargs.get('flavor', None)
host_id = kwargs.get('host_id', None)
Copy link
Member

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.

Copy link
Contributor Author

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.

'id,nextInvoiceTotalRecurringAmount,'
'children[categoryCode,nextInvoiceTotalRecurringAmount],'
'orderItem.order.userRecord[username]'
'orderItem[id,order.userRecord[username],preset.keyName]'
Copy link
Member

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']]):
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep. Adding.

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']
Copy link
Member

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.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 85.353% when pulling 610d464 on kwienken:vs-create-updates into 5c3e6ae on softlayer:master.

@kwienken kwienken merged commit df3ceca into softlayer:master Sep 13, 2017
@kwienken kwienken deleted the vs-create-updates branch January 15, 2018 22:15
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.

5 participants