コード例 #1
0
ファイル: mechanism_arista.py プロジェクト: gampel/neutron
    def register_with_eos(self):
        """This is the registration request with EOS.

        This the initial handshake between Neutron and EOS.
        critical end-point information is registered with EOS.
        """
        keystone_conf = self.keystone_conf
        # FIXME(ihrachys): plugins should not construct keystone URL
        # from configuration file and should instead rely on service
        # catalog contents
        auth_uri = utils.get_keystone_url(keystone_conf)

        cmds = ['auth url %(auth_url)s user %(user)s '
                'password %(password)s tenant %(tenant)s' %
                {'auth_url': auth_uri,
                 'user': keystone_conf.admin_user,
                 'password': keystone_conf.admin_password,
                 'tenant': keystone_conf.admin_tenant_name}]

        log_cmds = ['auth url %(auth_url)s user %(user)s '
                    'password %(password)s tenant %(tenant)s' %
                    {'auth_url': auth_uri,
                     'user': keystone_conf.admin_user,
                     'password': '******',
                     'tenant': keystone_conf.admin_tenant_name}]

        sync_interval_cmd = 'sync interval %d' % self.sync_interval
        cmds.append(sync_interval_cmd)
        log_cmds.append(sync_interval_cmd)

        self._run_openstack_cmds(cmds, commands_to_log=log_cmds)
コード例 #2
0
ファイル: sdnve_api.py プロジェクト: afori/neutron
    def __init__(self, username=None, tenant_name=None, password=None,
                 auth_url=None):

        keystone_conf = cfg.CONF.keystone_authtoken

        username = username or keystone_conf.admin_user
        tenant_name = tenant_name or keystone_conf.admin_tenant_name
        password = password or keystone_conf.admin_password
        # FIXME(ihrachys): plugins should not construct keystone URL
        # from configuration file and should instead rely on service
        # catalog contents
        auth_url = auth_url or utils.get_keystone_url(keystone_conf)

        self.overlay_signature = cfg.CONF.SDNVE.overlay_signature
        self.of_signature = cfg.CONF.SDNVE.of_signature
        self.default_tenant_type = cfg.CONF.SDNVE.default_tenant_type

        self.client = keyclient.Client(username=username,
                                       password=password,
                                       tenant_name=tenant_name,
                                       auth_url=auth_url)
コード例 #3
0
ファイル: sdnve_api.py プロジェクト: kjylmr/neutron
    def __init__(self, username=None, tenant_name=None, password=None,
                 auth_url=None):

        keystone_conf = cfg.CONF.keystone_authtoken

        username = username or keystone_conf.admin_user
        tenant_name = tenant_name or keystone_conf.admin_tenant_name
        password = password or keystone_conf.admin_password
        # FIXME(ihrachys): plugins should not construct keystone URL
        # from configuration file and should instead rely on service
        # catalog contents
        auth_url = auth_url or utils.get_keystone_url(keystone_conf)

        self.overlay_signature = cfg.CONF.SDNVE.overlay_signature
        self.of_signature = cfg.CONF.SDNVE.of_signature
        self.default_tenant_type = cfg.CONF.SDNVE.default_tenant_type

        self.client = keyclient.Client(username=username,
                                       password=password,
                                       tenant_name=tenant_name,
                                       auth_url=auth_url)
コード例 #4
0
 def test_register_with_eos(self):
     self.drv.register_with_eos()
     auth = fake_keystone_info_class()
     auth_cmd = (
         'auth url %(auth_url)s user %(user)s '
         'password %(password)s tenant %(tenant)s' %
         {'auth_url': utils.get_keystone_url(auth),
          'user': auth.admin_user,
          'password': auth.admin_password,
          'tenant': auth.admin_tenant_name}
     )
     cmds = ['enable',
             'configure',
             'cvx',
             'service openstack',
             'region %s' % self.region,
             auth_cmd,
             'sync interval %d' % cfg.CONF.ml2_arista.sync_interval,
             'exit',
             'exit',
             'exit',
             ]
     self.drv._server.runCmds.assert_called_once_with(version=1, cmds=cmds)
コード例 #5
0
 def test_register_with_eos(self):
     self.drv.register_with_eos()
     auth = fake_keystone_info_class()
     auth_cmd = (
         'auth url %(auth_url)s user %(user)s '
         'password %(password)s tenant %(tenant)s' %
         {'auth_url': utils.get_keystone_url(auth),
          'user': auth.admin_user,
          'password': auth.admin_password,
          'tenant': auth.admin_tenant_name}
     )
     cmds = ['enable',
             'configure',
             'cvx',
             'service openstack',
             'region %s' % self.region,
             auth_cmd,
             'sync interval %d' % cfg.CONF.ml2_arista.sync_interval,
             'exit',
             'exit',
             'exit',
             ]
     self.drv._server.runCmds.assert_called_once_with(version=1, cmds=cmds)
コード例 #6
0
    def register_with_eos(self):
        """This is the registration request with EOS.

        This the initial handshake between Neutron and EOS.
        critical end-point information is registered with EOS.
        """
        keystone_conf = self.keystone_conf
        # FIXME(ihrachys): plugins should not construct keystone URL
        # from configuration file and should instead rely on service
        # catalog contents
        auth_uri = utils.get_keystone_url(keystone_conf)

        cmds = [
            'auth url %(auth_url)s user %(user)s '
            'password %(password)s tenant %(tenant)s' % {
                'auth_url': auth_uri,
                'user': keystone_conf.admin_user,
                'password': keystone_conf.admin_password,
                'tenant': keystone_conf.admin_tenant_name
            }
        ]

        log_cmds = [
            'auth url %(auth_url)s user %(user)s '
            'password %(password)s tenant %(tenant)s' % {
                'auth_url': auth_uri,
                'user': keystone_conf.admin_user,
                'password': '******',
                'tenant': keystone_conf.admin_tenant_name
            }
        ]

        sync_interval_cmd = 'sync interval %d' % self.sync_interval
        cmds.append(sync_interval_cmd)
        log_cmds.append(sync_interval_cmd)

        self._run_openstack_cmds(cmds, commands_to_log=log_cmds)