Skip to content

Commit

Permalink
Fix traceback when create an operation without a name or option
Browse files Browse the repository at this point in the history
Resolves: rhbz#902460
  • Loading branch information
feist committed Jan 22, 2013
1 parent 2011cf7 commit 1897848
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pcs/resource.py
Expand Up @@ -444,9 +444,18 @@ def resource_operation_remove(res_id, argv):

utils.replace_cib_configuration(dom)

# Takes in a resource id and an array of operation values starting
# with the operation name, followed by options
# sample op_values = ["monitor", "interval=5s"]
def convert_args_to_operations(op_values, ra_id):
if len(op_values) == 0:
return []
if '=' in op_values[0]:
print "Error: When using 'op' you must specify an operation name after 'op'"
sys.exit(1)
if len(op_values) < 2:
print "Error: When using 'op' you must specify an operation name and at least one option"
sys.exit(1)
op_name = op_values.pop(0)
tuples = convert_args_to_tuples(op_values)
op_attrs = []
Expand Down

0 comments on commit 1897848

Please sign in to comment.