mirror of
				https://github.com/xcat2/confluent.git
				synced 2025-10-31 03:12:31 +00:00 
			
		
		
		
	Merge pull request #149 from tkucherera-lenovo/updateAttrib
check update args before setting anything
This commit is contained in:
		| @@ -595,7 +595,7 @@ def print_attrib_path(path, session, requestargs, options, rename=None, attrpref | ||||
|                 else: | ||||
|                     printmissing.add(attr) | ||||
|         for missing in printmissing: | ||||
|             sys.stderr.write('Error: {0} not a valid attribute\n'.format(attr)) | ||||
|             sys.stderr.write('Error: {0} not a valid attribute\n'.format(missing)) | ||||
|     return exitcode | ||||
|  | ||||
|  | ||||
| @@ -705,6 +705,14 @@ def updateattrib(session, updateargs, nodetype, noderange, options, dictassign=N | ||||
|                     noderange, 'attributes/all', dictassign[key], key) | ||||
|     else: | ||||
|         if "=" in updateargs[1]: | ||||
|             update_ready = True | ||||
|             for arg in updateargs[1:]: | ||||
|                 if not '=' in arg: | ||||
|                     update_ready = False | ||||
|                     exitcode = 1 | ||||
|             if not update_ready: | ||||
|                 sys.stderr.write('Error: {0} Can not set and read at the same time!\n'.format(str(updateargs[1:]))) | ||||
|                 sys.exit(exitcode) | ||||
|             try: | ||||
|                 for val in updateargs[1:]: | ||||
|                     val = val.split('=', 1) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user