File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,6 +52,8 @@ def cli(env, **args):
5252 """Order/create a dedicated server."""
5353
5454 template .update_with_template_args (args , list_args = ['key' ])
55+ _validate_args (args )
56+
5557 mgr = SoftLayer .HardwareManager (env .client )
5658
5759 # Get the SSH keys
@@ -125,3 +127,20 @@ def cli(env, **args):
125127 output = table
126128
127129 return output
130+
131+
132+ def _validate_args (args ):
133+ """Raises an ArgumentError if the given arguments are not valid."""
134+ missing = []
135+ for arg in ['size' ,
136+ 'datacenter' ,
137+ 'os' ,
138+ 'port_speed' ,
139+ 'hostname' ,
140+ 'domain' ]:
141+ if not args .get (arg ):
142+ missing .append (arg )
143+
144+ if missing :
145+ raise exceptions .ArgumentError ('Missing required options: %s'
146+ % ', ' .join (missing ))
Original file line number Diff line number Diff line change @@ -154,6 +154,14 @@ def cli(env, **args):
154154
155155def _validate_args (args ):
156156 """Raises an ArgumentError if the given arguments are not valid."""
157+ missing = []
158+ for arg in ['cpu' , 'memory' , 'hostname' , 'domain' ]:
159+ if not args .get (arg ):
160+ missing .append (arg )
161+
162+ if missing :
163+ raise exceptions .ArgumentError ('Missing required options: %s'
164+ % ', ' .join (missing ))
157165
158166 if all ([args ['userdata' ], args ['userfile' ]]):
159167 raise exceptions .ArgumentError (
Original file line number Diff line number Diff line change @@ -28,13 +28,12 @@ commands =
2828 pylint SoftLayer \
2929 -r n \ # Don't show the long report
3030 --ignore =tests,fixtures \
31- -d too-many-locals \ # Too many local variables
32- -d star-args \ # Used * or ** magic
33- -d I0011 \ # Locally Disabling
31+ -d too-many-locals \
32+ -d star-args \
33+ -d locally-disabled \
3434 --max-args =20 \
35- --max-branches =40 \
36- --max-statements =87 \
37- --max-returns =8 \
35+ --max-branches =20 \
36+ --max-statements =60 \
3837 --min-public-methods =0 \
3938 --min-similarity-lines =30
4039 pylint SoftLayer/testing/fixtures \
You can’t perform that action at this time.
0 commit comments