- ### locating the next available hostname (using ping)
- while True:
- try:
- (i,hostname,ip)=available.pop()
- if not utils.check_ping(hostname):
- break
- except:
- raise Exception('Cannot find an available IP for %s - exiting'%plc['name'])
+ if len(options.ips) != 0:
+ utils.header('ips=%r'%options.ips)
+ user_provided = options.ips.pop()
+ utils.header('vserver IP assignment : using user-provided %s'%user_provided)
+ (hostname,ip) = locate(user_provided)
+ else:
+ ### locating the next available hostname (using ping)
+ while True:
+ try:
+ (hostname,ip)=available.pop()
+ utils.header('vserver IP assignment : scanning IP %s'%ip)
+ if not utils.check_ping(hostname):
+ utils.header('IP %s is OK'%ip)
+ break
+ except:
+ raise Exception('Cannot find an available IP for %s - exiting'%plc['name'])