Example #1
0
 def config_auth(self, configfile):
     OpenStackService.config_auth(self, configfile)
     config = configparser.RawConfigParser(allow_no_value=True)
     config.read(configfile)
     auth_uri = config['keystone_authtoken']['auth_uri']
     config['trustee'] = config['keystone_authtoken']
     if not config.has_section('clients_keystone'):
         config.add_section('clients_keystone')
     config['clients_keystone']['auth_uri'] = auth_uri
     if not config.has_section('ec2authtoken'):
         config.add_section('ec2authtoken')
     config['ec2authtoken']['auth_uri'] = auth_uri
     with open(configfile, 'w') as f:
         config.write(f)
Example #2
0
 def config_auth(self, configfile):
     confdir = os.path.dirname(configfile)
     if not os.path.isdir(confdir):
         os.makedirs(confdir)
     shutil.copy('/usr/share/defaults/swift/proxy-server.conf', confdir)
     OpenStackService.config_auth(self, configfile,
                                  section='filter:authtoken')
     config = ("[pipeline:main]\n"
               "pipeline = catch_errors gatekeeper healthcheck "
               "proxy-logging cache container_sync bulk ratelimit "
               "authtoken keystoneauth container-quotas account-quotas "
               "slo dlo versioned_writes proxy-logging proxy-server\n"
               "[filter:authtoken]\n"
               "paste.filter_factory = "
               "keystonemiddleware.auth_token:filter_factory\n"
               "delay_auth_decision = True\n"
               "[app:proxy-server]\n"
               "use = egg:swift#proxy\n"
               "account_autocreate = True\n"
               "[filter:keystoneauth]\n"
               "use = egg:swift#keystoneauth\n"
               "operator_roles = admin,user\n")
     util.write_config(configfile, config)