예제 #1
0
 def _getAndValidateConfig(self):
     config = nodepool_config.loadConfig(self._config_path)
     if self._secure_path:
         nodepool_config.loadSecureConfig(config, self._secure_path)
     if not config.zookeeper_servers.values():
         raise RuntimeError('No ZooKeeper servers specified in config.')
     if not config.imagesdir:
         raise RuntimeError('No images-dir specified in config.')
     return config
예제 #2
0
 def _getAndValidateConfig(self):
     config = nodepool_config.loadConfig(self._config_path)
     if self._secure_path:
         nodepool_config.loadSecureConfig(config, self._secure_path)
     if not config.zookeeper_servers.values():
         raise RuntimeError('No ZooKeeper servers specified in config.')
     if not config.imagesdir:
         raise RuntimeError('No images-dir specified in config.')
     return config
예제 #3
0
    def _reloadConfig(self):
        '''
        Reload the nodepool configuration file.
        '''
        new_config = nodepool_config.loadConfig(self._config_path)
        if self._secure_path:
            nodepool_config.loadSecureConfig(new_config, self._secure_path)
        if not self._config:
            self._config = new_config

        self._checkForZooKeeperChanges(new_config)
        provider_manager.ProviderManager.reconfigure(self._config, new_config,
                                                     use_taskmanager=False)
        self._config = new_config
예제 #4
0
    def test_nodepool_occ_config(self):
        configfile = self.setup_config('integration_occ.yaml')
        auth_data = {'username': '******',
                     'project_name': 'os_real',
                     'password': '******',
                     'auth_url': 'os_real'}
        occ_config = {'clouds': {'real-cloud': {'auth': auth_data}}}
        self._use_cloud_config(occ_config)

        config = nodepool_config.loadConfig(configfile)
        self.assertIn('real-provider', config.providers)
        pm = provider_manager.get_provider(
            config.providers['real-provider'], use_taskmanager=False)
        pm.start()
        self.assertEqual(pm._client.auth, auth_data)
예제 #5
0
    def test_nodepool_occ_config(self):
        configfile = self.setup_config('integration_occ.yaml')
        auth_data = {'username': '******',
                     'project_name': 'os_real',
                     'password': '******',
                     'auth_url': 'os_real'}
        occ_config = {'clouds': {'real-cloud': {'auth': auth_data}}}
        self._use_cloud_config(occ_config)

        config = nodepool_config.loadConfig(configfile)
        self.assertIn('real-provider', config.providers)
        pm = provider_manager.get_provider(
            config.providers['real-provider'], use_taskmanager=False)
        pm.start(None)
        self.assertEqual(pm._client.auth, auth_data)
예제 #6
0
    def _reloadConfig(self):
        '''
        Reload the nodepool configuration file.
        '''
        new_config = nodepool_config.loadConfig(self._config_path)
        if self._secure_path:
            nodepool_config.loadSecureConfig(new_config, self._secure_path)
        if not self._config:
            self._config = new_config

        self._checkForZooKeeperChanges(new_config)
        provider_manager.ProviderManager.reconfigure(self._config,
                                                     new_config,
                                                     use_taskmanager=False)
        self._config = new_config
예제 #7
0
    def _run(self):
        '''
        Body of run method for exception handling purposes.
        '''
        # NOTE: For the first iteration, we expect self._config to be None
        new_config = nodepool_config.loadConfig(self._config_path)
        if self._secure_path:
            nodepool_config.loadSecureConfig(new_config, self._secure_path)
        if not self._config:
            self._config = new_config

        self._checkForZooKeeperChanges(new_config)
        self._config = new_config

        self._checkForScheduledImageUpdates()
        self._checkForManualBuildRequest()
예제 #8
0
    def _run(self):
        '''
        Body of run method for exception handling purposes.
        '''
        new_config = nodepool_config.loadConfig(self._config_path)
        if self._secure_path:
            nodepool_config.loadSecureConfig(new_config, self._secure_path)
        if not self._config:
            self._config = new_config

        self._checkForZooKeeperChanges(new_config)
        provider_manager.ProviderManager.reconfigure(self._config, new_config,
                                                     use_taskmanager=False)
        self._config = new_config

        self._cleanup()
예제 #9
0
    def _run(self):
        '''
        Body of run method for exception handling purposes.
        '''
        # NOTE: For the first iteration, we expect self._config to be None
        new_config = nodepool_config.loadConfig(self._config_path)
        if self._secure_path:
            nodepool_config.loadSecureConfig(new_config, self._secure_path)
        if not self._config:
            self._config = new_config

        self._checkForZooKeeperChanges(new_config)
        self._config = new_config

        self._checkForScheduledImageUpdates()
        self._checkForManualBuildRequest()
    def test_nodepool_occ_config(self):
        configfile = self.setup_config('integration_occ.yaml')
        auth_data = {'username': '******',
                     'project_name': 'os_real',
                     'password': '******',
                     'auth_url': 'os_real'}
        occ_config = {'clouds': {'real-cloud': {'auth': auth_data}}}
        self._use_cloud_config(occ_config)

        config = nodepool_config.loadConfig(configfile)
        self.assertIn('real-provider', config.providers)
        pm = provider_manager.get_provider(config.providers['real-provider'])
        # We need to cleanup the provider manager so that it doesn't leak a
        # thread that causes wait_for_threads in subsequent tests to fail.
        self.addCleanup(pm.stop)
        pm.start(None)
        self.assertEqual(pm._client.auth, auth_data)
예제 #11
0
    def _run(self):
        '''
        Body of run method for exception handling purposes.
        '''
        new_config = nodepool_config.loadConfig(self._config_path)
        if self._secure_path:
            nodepool_config.loadSecureConfig(new_config, self._secure_path)
        if not self._config:
            self._config = new_config

        self._checkForZooKeeperChanges(new_config)
        provider_manager.ProviderManager.reconfigure(self._config,
                                                     new_config,
                                                     use_taskmanager=False)
        self._config = new_config

        self._cleanup()
예제 #12
0
    def test_nodepool_occ_config(self):
        configfile = self.setup_config('integration_occ.yaml')
        auth_data = {
            'username': '******',
            'project_name': 'os_real',
            'password': '******',
            'auth_url': 'os_real'
        }
        occ_config = {'clouds': {'real-cloud': {'auth': auth_data}}}
        self._use_cloud_config(occ_config)

        config = nodepool_config.loadConfig(configfile)
        self.assertIn('real-provider', config.providers)
        pm = provider_manager.get_provider(config.providers['real-provider'])
        # We need to cleanup the provider manager so that it doesn't leak a
        # thread that causes wait_for_threads in subsequent tests to fail.
        self.addCleanup(pm.stop)
        pm.start(None)
        self.assertEqual(pm._client.auth, auth_data)
예제 #13
0
 def loadConfig(self):
     config = nodepool_config.loadConfig(self.configfile)
     if self.securefile:
         nodepool_config.loadSecureConfig(config, self.securefile)
     return config
예제 #14
0
 def test_static_config(self):
     configfile = self.setup_config('static.yaml')
     config = nodepool_config.loadConfig(configfile)
     self.assertIn('static-provider', config.providers)
예제 #15
0
 def loadConfig(self):
     config = nodepool_config.loadConfig(self.configfile)
     if self.securefile:
         nodepool_config.loadSecureConfig(config, self.securefile)
     return config
예제 #16
0
 def test_external_driver_config(self):
     configfile = self.setup_config('external_driver.yaml')
     nodepool_config.loadConfig(configfile)
     self.assertIn("config", Drivers.get("test"))
예제 #17
0
 def test_static_config(self):
     configfile = self.setup_config('static.yaml')
     config = nodepool_config.loadConfig(configfile)
     self.assertIn('static-provider', config.providers)