Some cleanups around environment variables made.
This commit is contained in:
@@ -210,11 +210,13 @@ class HorizonInstaller(comp.PythonInstallComponent):
|
|||||||
|
|
||||||
def _fix_quantum(self):
|
def _fix_quantum(self):
|
||||||
if not (utils.service_enabled(settings.QUANTUM_CLIENT, self.instances, False)):
|
if not (utils.service_enabled(settings.QUANTUM_CLIENT, self.instances, False)):
|
||||||
#Make the fake quantum
|
#make the fake quantum (apparently needed so imports don't fail???)
|
||||||
|
#TODO remove this...
|
||||||
quantum_dir = sh.joinpths(self.dash_dir, 'quantum')
|
quantum_dir = sh.joinpths(self.dash_dir, 'quantum')
|
||||||
self.tracewriter.make_dir(quantum_dir)
|
if not sh.isdir(quantum_dir):
|
||||||
self.tracewriter.touch_file(sh.joinpths(quantum_dir, '__init__.py'))
|
self.tracewriter.make_dir(quantum_dir)
|
||||||
self.tracewriter.touch_file(sh.joinpths(quantum_dir, 'client.py'))
|
self.tracewriter.touch_file(sh.joinpths(quantum_dir, '__init__.py'))
|
||||||
|
self.tracewriter.touch_file(sh.joinpths(quantum_dir, 'client.py'))
|
||||||
|
|
||||||
def post_install(self):
|
def post_install(self):
|
||||||
comp.PythonInstallComponent.post_install(self)
|
comp.PythonInstallComponent.post_install(self)
|
||||||
|
|||||||
@@ -28,6 +28,9 @@ from devstack.components import keystone
|
|||||||
#general extraction cfg keys
|
#general extraction cfg keys
|
||||||
CFG_MAKE = {
|
CFG_MAKE = {
|
||||||
'ADMIN_PASSWORD': ('passwords', 'horizon_keystone_admin'),
|
'ADMIN_PASSWORD': ('passwords', 'horizon_keystone_admin'),
|
||||||
|
'ADMIN_USER': ('keystone', 'admin_user'),
|
||||||
|
'DEMO_USER': ('keystone', 'demo_user'),
|
||||||
|
'INVISIBLE_USER': ('keystone', 'invisible_user'),
|
||||||
'MYSQL_PASSWORD': ('passwords', 'sql'),
|
'MYSQL_PASSWORD': ('passwords', 'sql'),
|
||||||
'RABBIT_PASSWORD': ('passwords', 'rabbit'),
|
'RABBIT_PASSWORD': ('passwords', 'rabbit'),
|
||||||
'SERVICE_TOKEN': ('passwords', 'service_token'),
|
'SERVICE_TOKEN': ('passwords', 'service_token'),
|
||||||
|
|||||||
@@ -14,6 +14,8 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
import tempfile
|
||||||
|
|
||||||
from optparse import IndentedHelpFormatter
|
from optparse import IndentedHelpFormatter
|
||||||
from optparse import OptionParser, OptionGroup
|
from optparse import OptionParser, OptionGroup
|
||||||
|
|
||||||
@@ -49,13 +51,13 @@ def parse():
|
|||||||
dest="action",
|
dest="action",
|
||||||
metavar="ACTION",
|
metavar="ACTION",
|
||||||
help="required action to perform: %s" % (_format_list(settings.ACTIONS)))
|
help="required action to perform: %s" % (_format_list(settings.ACTIONS)))
|
||||||
def_os_dir = sh.joinpths(sh.gethomedir(), DEF_OS_DIR)
|
default_dir = sh.joinpths(tempfile.gettempdir(), DEF_OS_DIR)
|
||||||
base_group.add_option("-d", "--directory",
|
base_group.add_option("-d", "--directory",
|
||||||
action="store",
|
action="store",
|
||||||
type="string",
|
type="string",
|
||||||
dest="dir",
|
dest="dir",
|
||||||
metavar="DIR",
|
metavar="DIR",
|
||||||
default=def_os_dir,
|
default=default_dir,
|
||||||
help=("empty root DIR for install or "
|
help=("empty root DIR for install or "
|
||||||
"DIR with existing components for start/stop/uninstall "
|
"DIR with existing components for start/stop/uninstall "
|
||||||
"(default: %default)"))
|
"(default: %default)"))
|
||||||
|
|||||||
@@ -307,12 +307,12 @@ def write_file(fn, text, flush=True, quiet=False):
|
|||||||
def touch_file(fn, die_if_there=True, quiet=False, file_size=0):
|
def touch_file(fn, die_if_there=True, quiet=False, file_size=0):
|
||||||
if not isfile(fn):
|
if not isfile(fn):
|
||||||
if not quiet:
|
if not quiet:
|
||||||
LOG.debug("Touching and truncating file %s", fn)
|
LOG.debug("Touching and truncating file %s (%s)", fn, file_size)
|
||||||
with open(fn, "w") as f:
|
with open(fn, "w") as f:
|
||||||
f.truncate(file_size)
|
f.truncate(file_size)
|
||||||
else:
|
else:
|
||||||
if die_if_there:
|
if die_if_there:
|
||||||
msg = "Can not touch file %s since it already exists" % (fn)
|
msg = "Can not touch & truncate file %s since it already exists" % (fn)
|
||||||
raise excp.FileException(msg)
|
raise excp.FileException(msg)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user