from openstack.icehouse.dashboard.dashboard import DashboardHA if __name__ == '__main__': print 'hello openstack-icehouse:dashboard============' print 'start time: %s' % time.ctime() #when execute script,exec: python <this file absolute path> #The params are retrieved from conf/openstack_params.json & /etc/puppet/localip, these two files are generated in init.pp in site.pp. ############################### INSTALL_TAG_FILE = '/opt/initDashboard' if os.path.exists(INSTALL_TAG_FILE) : print 'dashboard installed####' print 'exit====' pass else : Dashboard.start() DashboardHA.install() DashboardHA.configure() DashboardHA.start() # Dashboard.restart() DashboardHA.start() # ShellCmdExecutor.execCmd('service haproxy restart') #mark: dashboard is installed os.system('touch %s' % INSTALL_TAG_FILE) print 'hello openstack-icehouse:dashboard installed#######' pass
OPENSTACK_VERSION_TAG = 'kilo' OPENSTACK_CONF_FILE_TEMPLATE_DIR = os.path.join(PROJ_HOME_DIR, 'openstack', OPENSTACK_VERSION_TAG, 'configfile_template') sys.path.append(PROJ_HOME_DIR) from openstack.icehouse.dashboard.dashboard import Dashboard if __name__ == '__main__': print 'hello openstack-icehouse:dashboard============' print 'start time: %s' % time.ctime() #when execute script,exec: python <this file absolute path> #The params are retrieved from conf/openstack_params.json & /etc/puppet/localip, these two files are generated in init.pp in site.pp. ############################### RESTART_TAG_FILE = '/opt/restartDashboard' if os.path.exists(RESTART_TAG_FILE) : print 'dashboard restarted####' print 'exit====' pass else : Dashboard.configureDashboardRights() Dashboard.restart() # ShellCmdExecutor.execCmd('service haproxy restart') #mark: dashboard is installed os.system('touch %s' % RESTART_TAG_FILE) print 'hello openstack-icehouse:dashboard restarted#######' pass