diff --git a/fuelweb_test/helpers/fuel_actions.py b/fuelweb_test/helpers/fuel_actions.py index 1f6975e28..09d4bf985 100644 --- a/fuelweb_test/helpers/fuel_actions.py +++ b/fuelweb_test/helpers/fuel_actions.py @@ -34,6 +34,7 @@ from fuelweb_test.helpers import replace_repos from fuelweb_test.helpers.ssh_manager import SSHManager from fuelweb_test.settings import FUEL_PLUGIN_BUILDER_REPO from fuelweb_test.settings import FUEL_USE_LOCAL_NTPD +from fuelweb_test.settings import KEYSTONE_CREDS from fuelweb_test.settings import MIRROR_UBUNTU from fuelweb_test.settings import PLUGIN_PACKAGE_VERSION from fuelweb_test.settings import FUEL_SETTINGS_YAML @@ -181,6 +182,8 @@ class AdminActions(BaseActions): fuel_settings['DEBUG'] = True fuel_settings['DNS_UPSTREAM'] = router fuel_settings['ADMIN_NETWORK']['dhcp_gateway'] = router + fuel_settings["FUEL_ACCESS"]['user'] = KEYSTONE_CREDS['username'] + fuel_settings["FUEL_ACCESS"]['password'] = KEYSTONE_CREDS['password'] if FUEL_USE_LOCAL_NTPD: # Try to use only ntpd on the host as the time source diff --git a/fuelweb_test/models/environment.py b/fuelweb_test/models/environment.py index e09d4a2f5..ec7a7fb88 100644 --- a/fuelweb_test/models/environment.py +++ b/fuelweb_test/models/environment.py @@ -39,6 +39,7 @@ from fuelweb_test.helpers.fuel_actions import NessusActions from fuelweb_test.helpers.fuel_actions import FuelBootstrapCliActions from fuelweb_test.helpers.ssh_manager import SSHManager from fuelweb_test.helpers.utils import TimeStat +from fuelweb_test.helpers.utils import YamlEditor from fuelweb_test.helpers import multiple_networks_hacks from fuelweb_test.models.fuel_web_client import FuelWebClient from fuelweb_test.models.collector_client import CollectorClient @@ -367,6 +368,23 @@ class EnvironmentModel(object): cmd='fuel user --newpass {0} --change-password'.format( settings.KEYSTONE_CREDS['password']) ) + config_file = self.ssh_manager.execute_on_remote( + ip=self.ssh_manager.admin_ip, + cmd='ls -1 $HOME/.config/fuel/fuel_client.yaml')['stdout_str'] + + with YamlEditor(config_file, ip=self.admin_node_ip) as editor: + editor.content["OS_USERNAME"] = \ + settings.KEYSTONE_CREDS['username'] + editor.content["OS_PASSWORD"] = \ + settings.KEYSTONE_CREDS['password'] + + with YamlEditor(settings.FUEL_SETTINGS_YAML, + ip=self.admin_node_ip) as editor: + editor.content["FUEL_ACCESS"]['user'] = \ + settings.KEYSTONE_CREDS['username'] + editor.content["FUEL_ACCESS"]['password'] = \ + settings.KEYSTONE_CREDS['password'] + logger.info( 'New Fuel UI (keystone) username: "{0}", password: "{1}"' .format(settings.KEYSTONE_CREDS['username'],