def setup_config(test, control_address=u'10.0.0.1', control_port=1234, name=None, log_config=None):
 if (name is None):
  name = random_name(test)
 ca_set = get_credential_sets()[0]
 scratch_directory = test.make_temporary_directory()
 contents = {u'control-service': {u'hostname': control_address, u'port': control_port}, u'dataset': {u'backend': u'zfs', u'name': name, u'mount_root': scratch_directory.child('mount_root').path, u'volume_config_path': scratch_directory.child('volume_config.json').path}, u'version': 1}
 if (log_config is not None):
  contents[u'logging'] = log_config
 test.config = scratch_directory.child('dataset-config.yml')
 test.config.setContent(yaml.safe_dump(contents))
 ca_set.copy_to(scratch_directory, node=True)
 test.ca_set = ca_set

def setup_config ( test , control_address = u'10.0.0.1' , control_port = 1234 , name = None , log_config = None ) : if ( name is None ) : name = random_name ( test ) ca_set = get_credential_sets ( ) [ 0 ] scratch_directory = test . make_temporary_directory ( ) contents = { u'control-service' : { u'hostname' : control_address , u'port' : control_port } , u'dataset' : { u'backend' : u'zfs' , u'name' : name , u'mount_root' : scratch_directory . child ( 'mount_root' ) . path , u'volume_config_path' : scratch_directory . child ( 'volume_config.json' ) . path } , u'version' : 1 } if ( log_config is not None ) : contents [ u'logging' ] = log_config test . config = scratch_directory . child ( 'dataset-config.yml' ) test . config . setContent ( yaml . safe_dump ( contents ) ) ca_set . copy_to ( scratch_directory , node = True ) test . ca_set = ca_set
overwrite or make config .