def _get_spacewalk_configuration(spacewalk_url=''):
 spacewalk_config = (__opts__['spacewalk'] if ('spacewalk' in __opts__) else None)
 if spacewalk_config:
  try:
   for (spacewalk_server, service_config) in six.iteritems(spacewalk_config):
    username = service_config.get('username', None)
    password = service_config.get('password', None)
    protocol = service_config.get('protocol', 'https')
    if ((not username) or (not password)):
     log.error('Username or Password has not been specified in the master configuration for {0}'.format(spacewalk_server))
     return False
    ret = {'api_url': '{0}://{1}/rpc/api'.format(protocol, spacewalk_server), 'username': username, 'password': password}
    if ((not spacewalk_url) or (spacewalk_url == spacewalk_server)):
     return ret
  except Exception as exc:
   log.error('Exception encountered: {0}'.format(exc))
   return False
  if spacewalk_url:
   log.error('Configuration for {0} has not been specified in the master configuration'.format(spacewalk_url))
   return False
 return False

def _get_spacewalk_configuration ( spacewalk_url = '' ) : spacewalk_config = ( __opts__ [ 'spacewalk' ] if ( 'spacewalk' in __opts__ ) else None ) if spacewalk_config : try : for ( spacewalk_server , service_config ) in six . iteritems ( spacewalk_config ) : username = service_config . get ( 'username' , None ) password = service_config . get ( 'password' , None ) protocol = service_config . get ( 'protocol' , 'https' ) if ( ( not username ) or ( not password ) ) : log . error ( 'Username or Password has not been specified in the master configuration for {0}' . format ( spacewalk_server ) ) return False ret = { 'api_url' : '{0}://{1}/rpc/api' . format ( protocol , spacewalk_server ) , 'username' : username , 'password' : password } if ( ( not spacewalk_url ) or ( spacewalk_url == spacewalk_server ) ) : return ret except Exception as exc : log . error ( 'Exception encountered: {0}' . format ( exc ) ) return False if spacewalk_url : log . error ( 'Configuration for {0} has not been specified in the master configuration' . format ( spacewalk_url ) ) return False return False
return the configuration read from the master configuration file or directory .