def setUp(self): super(PuppetTestCaseMixin, self).setUp() self.operator = puppet.PuppetOperator(self.dbapi) self.useFixture(keyring_fixture.KeyringBackend()) self.mock_write_config = mock.patch.object(puppet.PuppetOperator, '_write_config').start() mock.patch('sysinv.common.utils.is_virtual', return_value=False).start() mock.patch( 'sysinv.puppet.kubernetes.KubernetesPuppet._get_host_join_command', return_value={}).start()
def create_host_config_action(path, hostname=None): dbapi = api.get_instance() operator = puppet.PuppetOperator(dbapi=dbapi, path=path) if hostname: host = dbapi.ihost_get_by_hostname(hostname) operator.update_host_config(host) else: hosts = dbapi.ihost_get_list() for host in hosts: operator.update_host_config(host)
def create_system_config_action(path): dbapi = api.get_instance() operator = puppet.PuppetOperator(dbapi=dbapi, path=path) operator.update_system_config() operator.update_secure_system_config()
def create_static_config_action(path): operator = puppet.PuppetOperator(path=path) operator.create_static_config() operator.create_secure_config()