Changeset 1117 for opsi/server/dass-opsi-tools/usr/bin
- Timestamp:
- Nov 9, 2012, 5:40:28 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
opsi/server/dass-opsi-tools/usr/bin/opsiclient
r1114 r1117 104 104 105 105 def createClient(self, name, opsiHostKey, description, notes, hardwareAddress, ipAddress): 106 self.rpc.host_createOpsiClient( name, opsiHostKey, description, notes, hardwareAddress, ipAddress ) 107 106 # self.rpc.host_createOpsiClient( name, opsiHostKey, description, notes, hardwareAddress, ipAddress ) 107 self.updateClient( name, opsiHostKey, description, notes, hardwareAddress, ipAddress ) 108 109 def updateClient(self, src, opsiHostKey = None, description = None, notes = None, hardwareAddress = None, ipAddress = None, depot = None ): 110 obj = { 111 "id" : src, 112 "type" : "OpsiClient", 113 } 114 if opsiHostKey: 115 obj['opsiHostKey'] = opsiHostKey 116 if description: 117 obj['description'] = description 118 if notes: 119 obj['notes'] = notes 120 if hardwareAddress: 121 obj['hardwareAddress'] = hardwareAddress 122 if ipAddress: 123 obj['ipAddress'] = ipAddress 124 125 if self.exists( src ): 126 self.rpc.host_updateObject(obj) 127 else: 128 self.rpc.host_insertObject(obj) 129 130 if depot: 131 self.clientSetDepot(src,depot) 132 return True 133 134 135 108 136 def clientSetDepot(self, name, depot): 109 137 self.rpc.configState_create( "clientconfig.depot.id", name, depot ) … … 310 338 parser_clean = subparsers.add_parser('clean', help='remove all product states from a opsi client' ) 311 339 parser_clean.add_argument( 'src', help="source opsi client to clean" ) 312 340 313 341 parser_copy = subparsers.add_parser('copy', help='copy/create a opsi client from a template opsi client') 314 342 parser_copy.add_argument( 'src', help="source/template opsi client" ) … … 331 359 parser_info = subparsers.add_parser('info', help='print information about a opsi client' ) 332 360 parser_info.add_argument( 'src', help="opsi client" ) 361 362 parser_update = subparsers.add_parser('update', help='update/create a opsi client') 363 parser_update.add_argument( 'src', help="opsi client to be created" ) 364 parser_update.add_argument( '--ip', help="IP address of the new opsi client" ) 365 parser_update.add_argument( '--mac', help="MAC address of the new opsi client" ) 366 parser_update.add_argument( '--description', help="IP address of the new opsi client" ) 367 parser_update.add_argument( '--notes', help="MAC address of the new opsi client" ) 368 parser_update.add_argument( '--depot', help="depot server the new opsi client should be located" ) 333 369 334 370 args = parser.parse_args() … … 366 402 result = opsi.listClients( args.product ) 367 403 elif args.subcommand == "info": 368 result = opsi.info( args.src ) 404 result = opsi.info( args.src ) 405 elif args.subcommand == "update": 406 result = opsi.updateClient( args.src, None, args.description, args.notes, args.mac, args.ip, args.depot ) 369 407 else: 370 408 print "not yet implemented"
Note:
See TracChangeset
for help on using the changeset viewer.