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
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
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
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)
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)
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
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 _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()
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)
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()
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)
def loadConfig(self): config = nodepool_config.loadConfig(self.configfile) if self.securefile: nodepool_config.loadSecureConfig(config, self.securefile) return config
def test_static_config(self): configfile = self.setup_config('static.yaml') config = nodepool_config.loadConfig(configfile) self.assertIn('static-provider', config.providers)
def loadConfig(self): config = nodepool_config.loadConfig(self.configfile) if self.securefile: nodepool_config.loadSecureConfig(config, self.securefile) return config
def test_external_driver_config(self): configfile = self.setup_config('external_driver.yaml') nodepool_config.loadConfig(configfile) self.assertIn("config", Drivers.get("test"))
def test_static_config(self): configfile = self.setup_config('static.yaml') config = nodepool_config.loadConfig(configfile) self.assertIn('static-provider', config.providers)