Skip to content

Commit 1ccbb07

Browse files
caberoscaberos
authored andcommitted
fix the team code review comments
1 parent d6ef561 commit 1ccbb07

3 files changed

Lines changed: 9 additions & 19 deletions

File tree

SoftLayer/CLI/autoscale/create.py

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
"""Order/create a dedicated server."""
1+
"""Order/Create a scale group."""
22
# :license: MIT, see LICENSE for more details.
33

44
import click
5+
from SoftLayer import utils
56

67
import SoftLayer
78
from SoftLayer.CLI import environment
@@ -36,13 +37,10 @@
3637
@helpers.multi_option('--disk', help="Disk sizes")
3738
@environment.pass_env
3839
def cli(env, **args):
39-
"""Order/create autoscale."""
40+
"""Order/Create a scale group."""
4041
scale = AutoScaleManager(env.client)
4142
network = SoftLayer.NetworkManager(env.client)
4243

43-
pods = network.get_closed_pods()
44-
closure = []
45-
4644
datacenter = network.get_datacenter(args.get('datacenter'))
4745

4846
ssh_keys = []
@@ -102,16 +100,10 @@ def cli(env, **args):
102100
'balancedTerminationFlag': False,
103101
'virtualGuestMemberTemplate': virt_template,
104102
'virtualGuestMemberCount': 0,
105-
'policies': policies.append(clean_dict(policy_template)),
103+
'policies': policies.append(utils.clean_dict(policy_template)),
106104
'terminationPolicyId': args['termination_policy']
107105
}
108106

109-
# print(virt_template)
110-
111-
for pod in pods:
112-
if args.get('datacenter') in str(pod['name']):
113-
closure.append(pod['name'])
114-
click.secho(click.style('Warning: Closed soon: %s' % (', '.join(closure)), fg='yellow'))
115107
if not (env.skip_confirmations or formatting.confirm(
116108
"This action will incur charges on your account. Continue?")):
117109
raise exceptions.CLIAbort('Aborting scale group order.')
@@ -130,8 +122,3 @@ def cli(env, **args):
130122
output = table
131123

132124
env.fout(output)
133-
134-
135-
def clean_dict(dictionary):
136-
"""Removes any `None` entires from the dictionary"""
137-
return {k: v for k, v in dictionary.items() if v}

SoftLayer/managers/network.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -830,8 +830,6 @@ def get_datacenter(self, _filter=None, datacenter=None):
830830
831831
returns datacenter list.
832832
"""
833-
_filter = None
834-
835833
if datacenter:
836834
_filter = {"name": {"operation": datacenter}}
837835

SoftLayer/utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,3 +427,8 @@ def format_comment(comment, max_line_length=60):
427427

428428
comment_length = len(word) + 1
429429
return formatted_comment
430+
431+
432+
def clean_dict(dictionary):
433+
"""Removes any `None` entires from the dictionary"""
434+
return {k: v for k, v in dictionary.items() if v}

0 commit comments

Comments
 (0)