Skip to content

Commit 9504d8f

Browse files
Merge pull request #1792 from caberos/issue1790
Add --extras to slcli order quote
2 parents 9a88af0 + d0d965d commit 9504d8f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

SoftLayer/CLI/order/quote.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from SoftLayer.CLI.command import SLCommand as SLCommand
66
from SoftLayer.CLI import environment
7+
from SoftLayer.CLI import exceptions
78
from SoftLayer.CLI import formatting
89
from SoftLayer.CLI import helpers
910
from SoftLayer.managers import ImageManager as ImageManager
@@ -32,6 +33,11 @@ def _parse_create_args(client, args):
3233
servers.append({'hostname': fqdn[0], 'domain': fqdn[1]})
3334
data['hardware'] = servers
3435

36+
if args.get('extras'):
37+
try:
38+
data['extras'] = args.get('extras')
39+
except ValueError as err:
40+
raise exceptions.CLIAbort("There was an error when parsing the --extras value: {}".format(err))
3541
if args.get('image'):
3642
if args.get('image').isdigit():
3743
image_mgr = ImageManager(client)
@@ -78,6 +84,8 @@ def _parse_create_args(client, args):
7884
@helpers.multi_option('--fqdn', required=True,
7985
help="<hostname>.<domain.name.tld> formatted name to use. Specify one fqdn per server")
8086
@click.option('--image', help="Image ID. See: 'slcli image list' for reference")
87+
@click.option('--extras',
88+
help="JSON string denoting extra data that needs to be sent with the order")
8189
@environment.pass_env
8290
def cli(env, quote, **args):
8391
"""View and Order a quote

0 commit comments

Comments
 (0)