Skip to content

Commit db50af5

Browse files
committed
Reorder option to catch transient and dedicated first.
1 parent 36e210b commit db50af5

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

SoftLayer/CLI/virt/create.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,6 @@ def _parse_create_args(client, args):
142142
if args.get('host_id'):
143143
data['host_id'] = args['host_id']
144144

145-
if args.get('transient') and not args.get('billing'):
146-
# No billing type specified and transient, so default to hourly
147-
data['billing'] = 'hourly'
148-
149145
if args.get('placementgroup'):
150146
resolver = SoftLayer.managers.PlacementManager(client).resolve_ids
151147
data['placement_id'] = helpers.resolve_id(resolver, args.get('placementgroup'), 'PlacementGroup')
@@ -290,6 +286,10 @@ def _validate_args(env, args):
290286
raise exceptions.ArgumentError(
291287
'[-m | --memory] not allowed with [-f | --flavor]')
292288

289+
if all([args['dedicated'], args['transient']]):
290+
raise exceptions.ArgumentError(
291+
'[--dedicated] not allowed with [--transient]')
292+
293293
if all([args['dedicated'], args['flavor']]):
294294
raise exceptions.ArgumentError(
295295
'[-d | --dedicated] not allowed with [-f | --flavor]')
@@ -298,10 +298,6 @@ def _validate_args(env, args):
298298
raise exceptions.ArgumentError(
299299
'[-h | --host-id] not allowed with [-f | --flavor]')
300300

301-
if all([args['dedicated'], args['transient']]):
302-
raise exceptions.ArgumentError(
303-
'[--dedicated] not allowed with [--transient]')
304-
305301
if args['transient'] and args['billing'] == 'monthly':
306302
raise exceptions.ArgumentError(
307303
'[--transient] not allowed with [--billing monthly]')

0 commit comments

Comments
 (0)