Hello community, here is the log from the commit of package openstack-utils for openSUSE:Factory checked in at 2013-10-30 15:48:12 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/openstack-utils (Old) and /work/SRC/openSUSE:Factory/.openstack-utils.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "openstack-utils" Changes: -------- --- /work/SRC/openSUSE:Factory/openstack-utils/openstack-utils.changes 2013-10-18 11:41:05.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.openstack-utils.new/openstack-utils.changes 2013-10-30 15:48:13.000000000 +0100 @@ -1,0 +2,43 @@ +Wed Oct 30 08:37:55 UTC 2013 - [email protected] + +- Apply patch properly to fix build. + +------------------------------------------------------------------- +Tue Oct 29 10:37:27 UTC 2013 - [email protected] + +- Fix syntax error in openstack-db (reported at + https://bugs.launchpad.net/openstack-manuals/+bug/1245778) + (updated patch fix-db.patch) + +------------------------------------------------------------------- +Mon Oct 28 15:39:11 UTC 2013 - [email protected] + +- Update to version 2013.2.1+git.1382396927.b17bebe: + + openstack-db: ask the user if changing the DB to mysqlbump release number + + openstack-status: print ceilometer alarm services status + + openstack-status: widen display to cater for wider service names + + initial import + + comments and copyright + + use systemctl instead of ls to generate service list + + added note about support distributions + + renamed osctl to openstack-service + + removed erroneous use of "sh" + + added qpid to list of openstack services + + Revert "added qpid to list of openstack services" + + maint: whitespace tweaks to align with openstack-utils + + require an action, and add --help + + provide service listing support on older Fedora + + openstack-db: add the --update option to sync the DB + + added Makefile + + openstack-service: mv osctl originated cmd into utils/ + + openstack-service: mention the new utility in NEWS + + openstack-service: add a man page + + doc: mention that openstack-db can update a db +- Refreshed fix-db.patch + +------------------------------------------------------------------- +Thu Oct 17 19:54:20 UTC 2013 - [email protected] + +- Fix openstack-db for SLES11 (update patch fix-db.patch) + +------------------------------------------------------------------- Old: ---- openstack-utils-2013.2.1+git.1379433390.6ec0116.tar.gz New: ---- openstack-utils-2013.2.1+git.1382396927.b17bebe.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ openstack-utils.spec ++++++ --- /var/tmp/diff_new_pack.rGQqQg/_old 2013-10-30 15:48:14.000000000 +0100 +++ /var/tmp/diff_new_pack.rGQqQg/_new 2013-10-30 15:48:14.000000000 +0100 @@ -17,7 +17,7 @@ Name: openstack-utils -Version: 2013.2.1+git.1379433390.6ec0116 +Version: 2013.2.1+git.1382396927.b17bebe Release: 0 Summary: Helper utilities for OpenStack service License: Apache-2.0 @@ -55,10 +55,12 @@ %{_bindir}/openstack-config %{_bindir}/openstack-db %{_bindir}/openstack-demo-install +%{_bindir}/openstack-service %{_bindir}/openstack-status %{_mandir}/man1/openstack-config.1%{?ext_man} %{_mandir}/man1/openstack-db.1%{?ext_man} %{_mandir}/man1/openstack-demo-install.1%{?ext_man} +%{_mandir}/man1/openstack-service.1.gz %{_mandir}/man1/openstack-status.1%{?ext_man} %changelog ++++++ _service ++++++ --- /var/tmp/diff_new_pack.rGQqQg/_old 2013-10-30 15:48:14.000000000 +0100 +++ /var/tmp/diff_new_pack.rGQqQg/_new 2013-10-30 15:48:14.000000000 +0100 @@ -1,18 +1,18 @@ <services> - <service name="tar_scm" mode="disabled"> + <service mode="disabled" name="tar_scm"> <param name="url">git://github.com/redhat-openstack/openstack-utils.git</param> <param name="scm">git</param> <param name="exclude">.git</param> <param name="versionformat">@PARENT_TAG@+git.%ct.%h</param> <param name="revision">master</param> - </service> + <param name="changesrevision">b17bebedea</param></service> - <service name="recompress" mode="disabled"> + <service mode="disabled" name="recompress"> <param name="file">openstack-utils-*.tar</param> <param name="compression">gz</param> </service> - <service name="set_version" mode="disabled"> + <service mode="disabled" name="set_version"> <param name="basename">openstack-utils</param> </service> -</services> +</services> \ No newline at end of file ++++++ fix-db.patch ++++++ --- /var/tmp/diff_new_pack.rGQqQg/_old 2013-10-30 15:48:14.000000000 +0100 +++ /var/tmp/diff_new_pack.rGQqQg/_new 2013-10-30 15:48:14.000000000 +0100 @@ -2,38 +2,66 @@ =================================================================== --- utils/openstack-db.orig +++ utils/openstack-db -@@ -88,9 +88,9 @@ esac +@@ -18,6 +18,7 @@ + # + + systemctl --version >/dev/null 2>&1 && systemctl=1 ++grep 'SUSE Linux Enterprise Server 11' /etc/SuSE-release > /dev/null && sles=1 + + usage() { + +@@ -98,7 +99,7 @@ db_manage() + db_cmd="db_$cmd" + fi + # Run as $APP user so any newly created (log) files have correct ownership +- runuser -s /bin/sh $APP -c "$APP-manage $db_cmd" ++ su -s /bin/sh -c "$APP-manage $db_sync" openstack-$APP + } + + db_sync() { db_manage sync; } +@@ -117,10 +118,15 @@ if [ "$MODE" = 'sync' ]; then + fi install_mysql_server() { ++ if test "$sles"; then ++ PACKAGES="mysql mysql-client" ++ else ++ PACKAGES="mariadb mariadb-client" ++ fi if [ -z "${ASSUME_YES}" ]; then - yum install mysql-server -+ zypper install mariadb mariadb-client ++ zypper install $PACKAGES else - yum install -y mysql-server -+ zypper install -y mariadb mariadb-client ++ zypper install -y $PACKAGES fi } -@@ -143,15 +143,15 @@ fi +@@ -173,15 +179,20 @@ fi # Make sure MySQL is installed. NEW_MYSQL_INSTALL=0 -if ! rpm -q --whatprovides mysql-server > /dev/null; then -+if ! rpm -q --whatprovides mariadb > /dev/null; then ++if test "$sles"; then ++ DB="mysql" ++else ++ DB="mariadb" ++fi ++if ! rpm -q --whatprovides $DB > /dev/null; then if [ -z "${ASSUME_YES}" ]; then - printf "mysql-server is not installed. Would you like to install it now? (y/n): " -+ printf "mariadb is not installed. Would you like to install it now? (y/n): " ++ printf "$DB is not installed. Would you like to install it now? (y/n): " read response case "$response" in y|Y) ;; n|N) - echo "mysql-server must be installed. Please install it before proceeding." -+ echo "mariadb must be installed. Please install it before proceeding." ++ echo "$DB must be installed. Please install it before proceeding." exit 0 ;; *) -@@ -167,7 +167,7 @@ fi +@@ -197,7 +208,7 @@ fi # Make sure mysqld is running. @@ -42,7 +70,7 @@ if [ -z "${ASSUME_YES}" ]; then printf "mysqld is not running. Would you like to start it now? (y/n): " read response -@@ -184,10 +184,10 @@ if ! service_running mysqld; then +@@ -214,10 +225,10 @@ if ! service_running mysqld; then esac fi @@ -55,12 +83,3 @@ fi -@@ -300,7 +300,7 @@ if [ "$MODE" = 'init' ]; then - db_sync='db_sync' - fi - # Run as $APP user so any newly created (log) files have correct ownership -- runuser -s /bin/sh $APP -c "$APP-manage $db_sync" -+ su -s /bin/sh -c "$APP-manage $db_sync" openstack-$APP - - # Do a final sanity check on the database. - if ! echo "SELECT * FROM migrate_version;" | ++++++ openstack-utils-2013.2.1+git.1379433390.6ec0116.tar.gz -> openstack-utils-2013.2.1+git.1382396927.b17bebe.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openstack-utils-2013.2.1+git.1379433390.6ec0116/NEWS new/openstack-utils-2013.2.1+git.1382396927.b17bebe/NEWS --- old/openstack-utils-2013.2.1+git.1379433390.6ec0116/NEWS 2013-09-27 16:24:44.000000000 +0200 +++ new/openstack-utils-2013.2.1+git.1382396927.b17bebe/NEWS 2013-10-28 16:39:11.000000000 +0100 @@ -1,3 +1,11 @@ +2013.2-? ??-??-???? + openstack-status: + print ceilometer alarm services status + openstack-db: + Add the --update option to sync the database + openstack-service: + Add a new util to control enabled openstack services + 2013.2-1 17-09-2013 openstack-status: don't print httpd status which is problematic on RHEL 6 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openstack-utils-2013.2.1+git.1379433390.6ec0116/README.md new/openstack-utils-2013.2.1+git.1382396927.b17bebe/README.md --- old/openstack-utils-2013.2.1+git.1379433390.6ec0116/README.md 2013-09-27 16:24:44.000000000 +0200 +++ new/openstack-utils-2013.2.1+git.1382396927.b17bebe/README.md 2013-10-28 16:39:11.000000000 +0100 @@ -4,6 +4,7 @@ Helper utilities for OpenStack services on Fedora/RHEL distros * openstack-config - Manipulate the openstack ini files -* openstack-db - Setup or delete the database for a specified service +* openstack-db - Create/Update/Delete, the database for a service * openstack-demo-install - Setup all services on a single node for testing * openstack-status - Give an overview of the status of installed services +* openstack-service - Control enabled openstack services diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openstack-utils-2013.2.1+git.1379433390.6ec0116/man/openstack-db.1 new/openstack-utils-2013.2.1+git.1382396927.b17bebe/man/openstack-db.1 --- old/openstack-utils-2013.2.1+git.1379433390.6ec0116/man/openstack-db.1 2013-09-27 16:24:44.000000000 +0200 +++ new/openstack-utils-2013.2.1+git.1382396927.b17bebe/man/openstack-db.1 2013-10-28 16:39:11.000000000 +0100 @@ -24,6 +24,10 @@ .IP Initialise the database. .HP +\fB\-\-update\fR +.IP +Update an initialised database. +.HP \fB\-\-password\fR <pw> | \fB\-p\fR <pw> .IP Specify the password for user that will be used diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openstack-utils-2013.2.1+git.1379433390.6ec0116/man/openstack-service.1 new/openstack-utils-2013.2.1+git.1382396927.b17bebe/man/openstack-service.1 --- old/openstack-utils-2013.2.1+git.1379433390.6ec0116/man/openstack-service.1 1970-01-01 01:00:00.000000000 +0100 +++ new/openstack-utils-2013.2.1+git.1382396927.b17bebe/man/openstack-service.1 2013-10-28 16:39:11.000000000 +0100 @@ -0,0 +1,12 @@ +.TH openstack-service "1" "October 2013" "openstack-utils" "User Commands" +.SH NAME +openstack-service - Control enabled openstack services +.SH SYNOPSIS +.B openstack-service +\fI<action> \fR[\fIservice\fR]... +.SH DESCRIPTION + <action> can be 'list' or an action supported by the service. + 'list' will list the enabled openstack services. + Any specified [service]s filter the list of enabled openstack services. +.SH SEE ALSO +openstack-status(1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openstack-utils-2013.2.1+git.1379433390.6ec0116/utils/openstack-db new/openstack-utils-2013.2.1+git.1382396927.b17bebe/utils/openstack-db --- old/openstack-utils-2013.2.1+git.1379433390.6ec0116/utils/openstack-db 2013-09-27 16:24:44.000000000 +0200 +++ new/openstack-utils-2013.2.1+git.1382396927.b17bebe/utils/openstack-db 2013-10-28 16:39:11.000000000 +0100 @@ -36,6 +36,8 @@ Drop the database. --init Initialise the database. + --update + Update an initialised database. --password <pw> | -p <pw> Specify the password for user that will be used to connect database for the service. By default the @@ -64,6 +66,7 @@ -h|--help) usage 0 ;; --drop) MODE='drop' ;; --init) MODE='init' ;; + --update) MODE='sync' ;; --service) shift; APP=$1 ;; -p|--password) shift; MYSQL_APP_PW=$1 ;; -r|--rootpw) shift; MYSQL_ROOT_PW=$1 ;; @@ -86,6 +89,33 @@ exit 1 ;; esac +db_manage() +{ + cmd="$1" + if [ "${APP}" = "nova" ] || [ "${APP}" = "cinder" ]; then + db_cmd="db $cmd" + else + db_cmd="db_$cmd" + fi + # Run as $APP user so any newly created (log) files have correct ownership + runuser -s /bin/sh $APP -c "$APP-manage $db_cmd" +} + +db_sync() { db_manage sync; } +db_synced() { db_manage version >/dev/null 2>&1; } + +if [ "$MODE" = 'sync' ]; then + if ! db_synced; then + echo "Can't determine the existing sync level." >&2 + echo "Please ensure the database is running and already initialised." >&2 + exit 1 + else + db_sync + echo "Complete!" + exit + fi +fi + install_mysql_server() { if [ -z "${ASSUME_YES}" ]; then yum install mysql-server @@ -294,13 +324,7 @@ # Ask openstack-$APP to sync the db. echo "Initializing the $APP database, please wait..." - if [ "${APP}" = "nova" ] || [ "${APP}" = "cinder" ]; then - db_sync='db sync' - else - db_sync='db_sync' - fi - # Run as $APP user so any newly created (log) files have correct ownership - runuser -s /bin/sh $APP -c "$APP-manage $db_sync" + db_sync # Do a final sanity check on the database. if ! echo "SELECT * FROM migrate_version;" | diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openstack-utils-2013.2.1+git.1379433390.6ec0116/utils/openstack-service new/openstack-utils-2013.2.1+git.1382396927.b17bebe/utils/openstack-service --- old/openstack-utils-2013.2.1+git.1379433390.6ec0116/utils/openstack-service 1970-01-01 01:00:00.000000000 +0100 +++ new/openstack-utils-2013.2.1+git.1382396927.b17bebe/utils/openstack-service 2013-10-28 16:39:11.000000000 +0100 @@ -0,0 +1,95 @@ +#!/bin/sh + +# Copyright (C) 2013, Red Hat, Inc. +# Lars Kellogg-Stedman <[email protected]> +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +if [ "$#" -lt 1 ] || [ "$1" = '--help' ]; then + echo "\ +NAME + openstack-service - control enabled openstack services + +SYNOPSIS + $(basename "$0") <action> [service]... + +DESCRIPTION + <action> can be 'list' or an action supported by the service. + 'list' will list the enabled openstack services. + Any specified [service]s filter the list of enabled openstack services. + +SEE ALSO + openstack-status(1)" >&2 + [ "$1" = '--help' ] && exit 0 || exit 1 +fi + +systemctl --version >/dev/null 2>&1 && systemctl=1 +[ "$systemctl" ] || RUNLEVEL=$(LANG=C who -r | sed 's/.*run-level \([0-9]\).*/\1/') + +# This generates a list of all services currently enabled on the host +# (for certain values of "enabled" where systemd is concerned -- currently, +# we check multi-user.target.wants for a list of enabled services). +# +# The systemctl command used here comes mostly from: +# http://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet +enabled_services() { + if [ "$systemctl" = 1 ]; then + if systemctl list-unit-files >/dev/null 2>&1; then + systemctl list-unit-files --type=service --full --no-legend --no-pager | + awk '$2 == "enabled" {print $1}' | + sed 's/.service$//' + else + # This fallback may list disabled but loaded services + systemctl list-units --type=service --full --no-pager | + sed -n 's/\.service.*//p' + fi + else + chkconfig --list | grep "${RUNLEVEL}:on" | awk '{print $1}' + fi +} + +# This filters the results of enabled_services() for those services +# related to openstack, and optionally restricts those to ones +# that start with a specifc prefix (e.g., "cinder" or "glance"). +enabled_openstack_services() { + local svcprefix=$1 + + enabled_services | + egrep '^(openstack|neutron|quantum)' | + ( [ "$svcprefix" ] && egrep "^(openstack-)?${svcprefix}" || cat ) +} + +# This calls enable_openstack_services once for each value in "$@", or once +# with no prefix if there are no arguments. +generate_service_list() { + if [ "$*" ]; then + for svcprefix in "$@"; do + enabled_openstack_services $svcprefix + done + else + enabled_openstack_services + fi +} + +# $action may be empty, "list", or any argument appropriate to the "service" +# command. $action can only be empty if there are no service prefixes +# on the command line. +action="$1" +shift + +# Generate a list of services and either print the list on stdout for "list" +# or use the "service" command to perform the requested action on each of +# the services. +generate_service_list "$@" | +( [ "$action" = "list" ] && cat || xargs -iSVC service SVC $action ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openstack-utils-2013.2.1+git.1379433390.6ec0116/utils/openstack-status new/openstack-utils-2013.2.1+git.1382396927.b17bebe/utils/openstack-status --- old/openstack-utils-2013.2.1+git.1379433390.6ec0116/utils/openstack-status 2013-09-27 16:24:44.000000000 +0200 +++ new/openstack-utils-2013.2.1+git.1382396927.b17bebe/utils/openstack-status 2013-10-28 16:39:11.000000000 +0100 @@ -85,7 +85,7 @@ check_sysv_svc() { - printf '%-30s' "$1:" + printf '%-40' "$1:" bootstatus=$(service_enabled $1 && echo enabled || echo disabled) status=$(service $1 status >/dev/null 2>/dev/null ; lsb_to_string $?) if [ "$bootstatus" = 'disabled' ]; then @@ -103,7 +103,7 @@ return fi - printf '%-30s' "$1:" + printf '%-40s' "$1:" bootstatus=$(service_enabled $1 && echo enabled || echo disabled) status=$(systemctl is-active $1.service 2>/dev/null) # For "simple" systemd services you get @@ -139,7 +139,7 @@ printf "== Horizon service ==\n" horizon_status="$(curl -s -w '%{http_code}\n' http://localhost/dashboard -o /dev/null)" [ "$horizon_status" = 200 ] && horizon_status=active - printf '%-30s%s\n' "openstack-dashboard:" "$horizon_status" + printf '%-40s%s\n' "openstack-dashboard:" "$horizon_status" fi if test "$neutron"; then @@ -180,7 +180,9 @@ if test "$ceilometer"; then printf "== Ceilometer services ==\n" - for service in api central compute collector; do + service_installed openstack-ceilometer-alarm-notifier && notifier=alarm-notifier + service_installed openstack-ceilometer-alarm-evaluator && evaluator=alarm-evaluator + for service in api central compute collector $notifier $evaluator; do check_svc openstack-ceilometer-$service done fi -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
