def build_controller_args(facts):
 cloud_cfg_path = os.path.join(facts['common']['config_base'], 'cloudprovider')
 if ('master' in facts):
  controller_args = {}
  if ('cloudprovider' in facts):
   if ('kind' in facts['cloudprovider']):
    if (facts['cloudprovider']['kind'] == 'aws'):
     controller_args['cloud-provider'] = ['aws']
     controller_args['cloud-config'] = [(cloud_cfg_path + '/aws.conf')]
    if (facts['cloudprovider']['kind'] == 'openstack'):
     controller_args['cloud-provider'] = ['openstack']
     controller_args['cloud-config'] = [(cloud_cfg_path + '/openstack.conf')]
    if (facts['cloudprovider']['kind'] == 'gce'):
     controller_args['cloud-provider'] = ['gce']
     controller_args['cloud-config'] = [(cloud_cfg_path + '/gce.conf')]
  if (controller_args != {}):
   facts = merge_facts({'master': {'controller_args': controller_args}}, facts, [], [])
 return facts

def build_controller_args ( facts ) : cloud_cfg_path = os . path . join ( facts [ 'common' ] [ 'config_base' ] , 'cloudprovider' ) if ( 'master' in facts ) : controller_args = { } if ( 'cloudprovider' in facts ) : if ( 'kind' in facts [ 'cloudprovider' ] ) : if ( facts [ 'cloudprovider' ] [ 'kind' ] == 'aws' ) : controller_args [ 'cloud-provider' ] = [ 'aws' ] controller_args [ 'cloud-config' ] = [ ( cloud_cfg_path + '/aws.conf' ) ] if ( facts [ 'cloudprovider' ] [ 'kind' ] == 'openstack' ) : controller_args [ 'cloud-provider' ] = [ 'openstack' ] controller_args [ 'cloud-config' ] = [ ( cloud_cfg_path + '/openstack.conf' ) ] if ( facts [ 'cloudprovider' ] [ 'kind' ] == 'gce' ) : controller_args [ 'cloud-provider' ] = [ 'gce' ] controller_args [ 'cloud-config' ] = [ ( cloud_cfg_path + '/gce.conf' ) ] if ( controller_args != { } ) : facts = merge_facts ( { 'master' : { 'controller_args' : controller_args } } , facts , [ ] , [ ] ) return facts
build master controller_args .