Creates keystonerc_admin for user
- creates keystonerc_admin for user running Packstack in case OpenStack client host is the host where packstack is running (eg. all-in-one installation) Change-Id: I37be40de46f54c78c934a27bc3f5e3c9381e7f19 Fixes: rhbz#964005, rhbz#976394
This commit is contained in:
		| @@ -3,6 +3,7 @@ Installs and configures an OpenStack Client | ||||
| """ | ||||
|  | ||||
| import logging | ||||
| import os | ||||
|  | ||||
| from packstack.installer import validators | ||||
| from packstack.installer import basedefs, output_messages | ||||
| @@ -57,16 +58,34 @@ def initSequences(controller): | ||||
|     ] | ||||
|     controller.addSequence("Installing OpenStack Client", [], [], osclientsteps) | ||||
|  | ||||
|  | ||||
| def createmanifest(config): | ||||
|     client_host = controller.CONF['CONFIG_OSCLIENT_HOST'].strip() | ||||
|     client_host = config['CONFIG_OSCLIENT_HOST'].strip() | ||||
|     manifestfile = "%s_osclient.pp" % client_host | ||||
|     manifestdata = getManifestTemplate("openstack_client.pp") | ||||
|     appendManifestFile(manifestfile, manifestdata) | ||||
|  | ||||
|     server = utils.ScriptRunner(client_host) | ||||
|     server.append('echo $HOME') | ||||
|     rc, root_home = server.execute() | ||||
|     root_home = root_home.strip() | ||||
|  | ||||
|     msg = ("To use the command line tools you need to source the file " | ||||
|            "%s/keystonerc_admin created on %s") | ||||
|     controller.MESSAGES.append(msg % (root_home.strip(), client_host)) | ||||
|     homedir = os.path.expanduser('~') | ||||
|     config['HOME_DIR'] = homedir | ||||
|  | ||||
|     uname, gname = utils.get_current_username() | ||||
|     config['NO_ROOT_USER'], config['NO_ROOT_GROUP'] = uname, gname | ||||
|  | ||||
|     no_root_allinone = (client_host == utils.get_localhost_ip() and | ||||
|                         root_home != homedir) | ||||
|     config['NO_ROOT_USER_ALLINONE'] = no_root_allinone and 'true' or 'false' | ||||
|  | ||||
|     manifestdata = getManifestTemplate("openstack_client.pp") | ||||
|     appendManifestFile(manifestfile, manifestdata) | ||||
|  | ||||
|     msg = ("File %s/keystonerc_admin has been created on OpenStack client host" | ||||
|            " %s. To use the command line tools you need to source the file.") | ||||
|     controller.MESSAGES.append(msg % (root_home, client_host)) | ||||
|  | ||||
|     if no_root_allinone: | ||||
|         msg = ("Copy of keystonerc_admin file has been created for non-root " | ||||
|                "user in %s.") | ||||
|         controller.MESSAGES.append(msg % homedir) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Martin Magr
					Martin Magr