def parse_change_values_from_opts(opts):
 change_values = {}
 for key in ('change_ip', 'change_port', 'change_replication_ip', 'change_replication_port', 'change_device', 'change_meta'):
  value = getattr(opts, key, None)
  if value:
   if ((key == 'change_ip') or (key == 'change_replication_ip')):
    value = validate_and_normalize_address(value)
   change_values[key.replace('change_', '')] = value
 return change_values

def parse_change_values_from_opts ( opts ) : change_values = { } for key in ( 'change_ip' , 'change_port' , 'change_replication_ip' , 'change_replication_port' , 'change_device' , 'change_meta' ) : value = getattr ( opts , key , None ) if value : if ( ( key == 'change_ip' ) or ( key == 'change_replication_ip' ) ) : value = validate_and_normalize_address ( value ) change_values [ key . replace ( 'change_' , '' ) ] = value return change_values
convert optparse style options into a dictionary for changing .