Changeset 1177
- Timestamp:
- May 13, 2015, 4:46:01 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
opsi/server/dass-opsi-tools/usr/bin/opsiclient
r1176 r1177 113 113 def createClient(self, name, opsiHostKey, description, notes, hardwareAddress, ipAddress): 114 114 # self.rpc.host_createOpsiClient( name, opsiHostKey, description, notes, hardwareAddress, ipAddress ) 115 self.updateClient( name, opsiHostKey, description, notes, hardwareAddress, ipAddress )115 self.updateClient( name, opsiHostKey, description, notes, None, hardwareAddress, ipAddress ) 116 116 117 117 def deleteClient(self, name): 118 118 self.rpc.host_delete( name ) 119 119 120 def updateClient(self, src, opsiHostKey = None, description = None, notes = None, hardwareAddress = None, ipAddress = None, depot = None ):120 def updateClient(self, src, opsiHostKey = None, description = None, notes = None, inventoryNumber = None, hardwareAddress = None, ipAddress = None, depot = None ): 121 121 obj = { 122 122 "id" : src, … … 129 129 if notes: 130 130 obj['notes'] = notes 131 if inventoryNumber: 132 obj['inventoryNumber'] = inventoryNumber 131 133 if hardwareAddress: 132 134 obj['hardwareAddress'] = hardwareAddress … … 312 314 fd.write( "# automatically generated at {0}\n".format( time.asctime() ) ) 313 315 fd.write( "#\n\n" ) 314 except BaseException as e: 316 except BaseException as e: 315 317 self.logger.exception( "failed to create files" ) 316 318 return False … … 395 397 396 398 parser_update = subparsers.add_parser('update', help='update/create a opsi client') 397 parser_update.add_argument( 'src', help="opsi client to be created" ) 398 parser_update.add_argument( '--ip', help="IP address of the new opsi client" ) 399 parser_update.add_argument( '--mac', help="MAC address of the new opsi client" ) 400 parser_update.add_argument( '--description', help="IP address of the new opsi client" ) 401 parser_update.add_argument( '--notes', help="MAC address of the new opsi client" ) 402 parser_update.add_argument( '--depot', help="depot server the new opsi client should be located" ) 403 399 parser_update.add_argument( 'src', help="opsi client to be created/updated" ) 400 parser_update.add_argument( '--ip', help="IP address of the opsi client" ) 401 parser_update.add_argument( '--mac', help="MAC address of the opsi client" ) 402 parser_update.add_argument( '--description', help="a description of the client" ) 403 parser_update.add_argument( '--notes', help="notes about the client" ) 404 parser_update.add_argument( '--inventory', help="inventory number" ) 405 parser_update.add_argument( '--depot', help="depot server the opsi client should be located" ) 406 404 407 args = parser.parse_args() 405 408 406 409 if args.debug: 407 410 logger.setLevel(logging.DEBUG) … … 439 442 result = opsi.info( args.src ) 440 443 elif args.subcommand == "update": 441 result = opsi.updateClient( args.src, None, args.description, args.notes, args. mac, args.ip, args.depot )444 result = opsi.updateClient( args.src, None, args.description, args.notes, args.inventory, args.mac, args.ip, args.depot ) 442 445 else: 443 446 print "not yet implemented"
Note:
See TracChangeset
for help on using the changeset viewer.