diff --git a/.gitignore b/.gitignore index 86e801169..329400bb2 100644 --- a/.gitignore +++ b/.gitignore @@ -58,4 +58,4 @@ ChangeLog releasenotes/build # generated config file -etc/higgins/higgins.conf.sample +etc/zun/zun.conf.sample diff --git a/.testr.conf b/.testr.conf index 414b5d510..7d07b1171 100644 --- a/.testr.conf +++ b/.testr.conf @@ -2,6 +2,6 @@ test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \ OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-45} \ - ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./higgins/tests/unit} $LISTOPT $IDOPTION + ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./zun/tests/unit} $LISTOPT $IDOPTION test_id_option=--load-list $IDFILE test_list_option=--list diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 42ef18bbc..c96c2e6f9 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -14,4 +14,4 @@ Pull requests submitted through GitHub will be ignored. Bugs should be filed on Launchpad, not GitHub: - https://bugs.launchpad.net/higgins + https://bugs.launchpad.net/zun diff --git a/HACKING.rst b/HACKING.rst index 85e510650..c898fb8ac 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -1,10 +1,10 @@ -Higgins Style Commandments -========================== +Zun Style Commandments +====================== Read the OpenStack Style Commandments http://docs.openstack.org/developer/hacking/ -Higgins Specific Commandments ------------------------------ +Zun Specific Commandments +------------------------- - [M302] Change assertEqual(A is not None) by optimal assert like assertIsNotNone(A). diff --git a/README.rst b/README.rst index b5a877b23..f9963cbc7 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,6 @@ -======= -Higgins -======= +=== +Zun +=== Container Management service for OpenStack @@ -9,11 +9,11 @@ Please fill here a long description which must be at least 3 lines wrapped on Note that this is a hard requirement. * Free software: Apache license -* Documentation: http://docs.openstack.org/developer/higgins +* Documentation: http://docs.openstack.org/developer/zun * Source: http://git.openstack.org/cgit/openstack/higgins -* Bugs: http://bugs.launchpad.net/python-higgins -* Blueprints:** https://blueprints.launchpad.net/higgins -* REST Client:** http://git.openstack.org/cgit/openstack/python-higginsclient +* Bugs: http://bugs.launchpad.net/zun +* Blueprints:** https://blueprints.launchpad.net/zun +* REST Client:** http://git.openstack.org/cgit/openstack/python-zunclient Features -------- diff --git a/devstack/README.rst b/devstack/README.rst index dd9b6f2aa..821b7c111 100644 --- a/devstack/README.rst +++ b/devstack/README.rst @@ -2,18 +2,18 @@ DevStack Integration ==================== -This directory contains the files necessary to integrate higgins with devstack. +This directory contains the files necessary to integrate zun with devstack. Refer the quickstart guide at https://github.com/openstack/higgins/blob/master/doc/source/dev/quickstart.rst -for more information on using devstack and higgins. +for more information on using devstack and zun. -To install higgins into devstack, add the following settings to enable the -higgins plugin:: +To install zun into devstack, add the following settings to enable the +zun plugin:: cat > /opt/stack/devstack/local.conf << END [[local|localrc]] - enable_plugin higgins https://git.openstack.org/openstack/higgins master + enable_plugin zun https://git.openstack.org/openstack/higgins master END Then run devstack normally:: diff --git a/devstack/lib/higgins b/devstack/lib/higgins deleted file mode 100644 index a4154bd1a..000000000 --- a/devstack/lib/higgins +++ /dev/null @@ -1,268 +0,0 @@ -#!/bin/bash -# -# lib/higgins -# Functions to control the configuration and operation of the **higgins** service - -# Dependencies: -# -# - ``functions`` file -# - ``DEST``, ``DATA_DIR``, ``STACK_USER`` must be defined -# - ``SERVICE_{TENANT_NAME|PASSWORD}`` must be defined - -# ``stack.sh`` calls the entry points in this order: -# -# - install_higgins -# - configure_higgins -# - create_higgins_conf -# - create_higgins_accounts -# - init_higgins -# - start_higgins -# - stop_higgins -# - cleanup_higgins - -# Save trace setting -XTRACE=$(set +o | grep xtrace) -set +o xtrace - - -# Defaults -# -------- - -# Set up default directories -HIGGINS_REPO=${HIGGINS_REPO:-${GIT_BASE}/openstack/higgins.git} -HIGGINS_BRANCH=${HIGGINS_BRANCH:-master} -HIGGINS_DIR=$DEST/higgins - -HIGGINS_STATE_PATH=${HIGGINS_STATE_PATH:=$DATA_DIR/higgins} -HIGGINS_AUTH_CACHE_DIR=${HIGGINS_AUTH_CACHE_DIR:-/var/cache/higgins} - -HIGGINS_CONF_DIR=/etc/higgins -HIGGINS_CONF=$HIGGINS_CONF_DIR/higgins.conf -HIGGINS_POLICY_JSON=$HIGGINS_CONF_DIR/policy.json -HIGGINS_API_PASTE=$HIGGINS_CONF_DIR/api-paste.ini - -if is_ssl_enabled_service "higgins" || is_service_enabled tls-proxy; then - HIGGINS_SERVICE_PROTOCOL="https" -fi - -# Public facing bits -HIGGINS_SERVICE_HOST=${HIGGINS_SERVICE_HOST:-$HOST_IP} -HIGGINS_SERVICE_PORT=${HIGGINS_SERVICE_PORT:-9517} -HIGGINS_SERVICE_PORT_INT=${HIGGINS_SERVICE_PORT_INT:-19517} -HIGGINS_SERVICE_PROTOCOL=${HIGGINS_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL} - -HIGGINS_TRUSTEE_DOMAIN_ADMIN_PASSWORD=${HIGGINS_TRUSTEE_DOMAIN_ADMIN_PASSWORD:-secret} - -# Support entry points installation of console scripts -if [[ -d $HIGGINS_DIR/bin ]]; then - HIGGINS_BIN_DIR=$HIGGINS_DIR/bin -else - HIGGINS_BIN_DIR=$(get_python_exec_prefix) -fi - -# Functions -# --------- - -# Test if any higgins services are enabled -# is_higgins_enabled -function is_higgins_enabled { - [[ ,${ENABLED_SERVICES} =~ ,"higgins-" ]] && return 0 - return 1 -} -# cleanup_higgins() - Remove residual data files, anything left over from previous -# runs that a clean run would need to clean up -function cleanup_higgins { - sudo rm -rf $HIGGINS_STATE_PATH $HIGGINS_AUTH_CACHE_DIR -} - -# configure_higgins() - Set config files, create data dirs, etc -function configure_higgins { - # Put config files in ``/etc/higgins`` for everyone to find - if [[ ! -d $HIGGINS_CONF_DIR ]]; then - sudo mkdir -p $HIGGINS_CONF_DIR - sudo chown $STACK_USER $HIGGINS_CONF_DIR - fi - - install_default_policy higgins - # Rebuild the config file from scratch - create_higgins_conf - - create_api_paste_conf - -} - -# create_higgins_accounts() - Set up common required HIGGINS accounts -# -# Project User Roles -# ------------------------------------------------------------------ -# SERVICE_PROJECT_NAME higgins service -function create_higgins_accounts { - - create_service_user "higgins" "admin" - - if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then - - local higgins_service=$(get_or_create_service "higgins" \ - "container" "Container As Service") - get_or_create_endpoint $higgins_service \ - "$REGION_NAME" \ - "$HIGGINS_SERVICE_PROTOCOL://$HIGGINS_SERVICE_HOST:$HIGGINS_SERVICE_PORT/v1" \ - "$HIGGINS_SERVICE_PROTOCOL://$HIGGINS_SERVICE_HOST:$HIGGINS_SERVICE_PORT/v1" \ - "$HIGGINS_SERVICE_PROTOCOL://$HIGGINS_SERVICE_HOST:$HIGGINS_SERVICE_PORT/v1" - fi - -} - -# create_higgins_conf() - Create a new higgins.conf file -function create_higgins_conf { - - # (Re)create ``higgins.conf`` - rm -f $HIGGINS_CONF - iniset $HIGGINS_CONF DEFAULT debug "$ENABLE_DEBUG_LOG_LEVEL" - iniset $HIGGINS_CONF oslo_messaging_rabbit rabbit_userid $RABBIT_USERID - iniset $HIGGINS_CONF oslo_messaging_rabbit rabbit_password $RABBIT_PASSWORD - iniset $HIGGINS_CONF oslo_messaging_rabbit rabbit_host $RABBIT_HOST - - iniset $HIGGINS_CONF database connection `database_connection_url higgins` - iniset $HIGGINS_CONF api host "$HIGGINS_SERVICE_HOST" - iniset $HIGGINS_CONF api port "$HIGGINS_SERVICE_PORT" - - iniset $HIGGINS_CONF oslo_policy policy_file $HIGGINS_POLICY_JSON - - iniset $HIGGINS_CONF keystone_auth auth_type password - iniset $HIGGINS_CONF keystone_auth username higgins - iniset $HIGGINS_CONF keystone_auth password $SERVICE_PASSWORD - iniset $HIGGINS_CONF keystone_auth project_name $SERVICE_PROJECT_NAME - iniset $HIGGINS_CONF keystone_auth project_domain_id default - iniset $HIGGINS_CONF keystone_auth user_domain_id default - - # FIXME(pauloewerton): keystone_authtoken section is deprecated. Remove it - # after deprecation period. - iniset $HIGGINS_CONF keystone_authtoken admin_user higgins - iniset $HIGGINS_CONF keystone_authtoken admin_password $SERVICE_PASSWORD - iniset $HIGGINS_CONF keystone_authtoken admin_tenant_name $SERVICE_PROJECT_NAME - - configure_auth_token_middleware $HIGGINS_CONF higgins $HIGGINS_AUTH_CACHE_DIR - - iniset $HIGGINS_CONF keystone_auth auth_url $KEYSTONE_SERVICE_URI/v3 - iniset $HIGGINS_CONF keystone_authtoken auth_uri \ - ${KEYSTONE_SERVICE_PROTOCOL}://${HOST_IP}:${KEYSTONE_SERVICE_PORT}/v3 - iniset $HIGGINS_CONF keystone_authtoken auth_version v3 - - if is_fedora || is_suse; then - # higgins defaults to /usr/local/bin, but fedora and suse pip like to - # install things in /usr/bin - iniset $HIGGINS_CONF DEFAULT bindir "/usr/bin" - fi - - if [ -n "$HIGGINS_STATE_PATH" ]; then - iniset $HIGGINS_CONF DEFAULT state_path "$HIGGINS_STATE_PATH" - iniset $HIGGINS_CONF oslo_concurrency lock_path "$HIGGINS_STATE_PATH" - fi - - if [ "$SYSLOG" != "False" ]; then - iniset $HIGGINS_CONF DEFAULT use_syslog "True" - fi - - # Format logging - if [ "$LOG_COLOR" == "True" ] && [ "$SYSLOG" == "False" ]; then - setup_colorized_logging $HIGGINS_CONF DEFAULT - else - # Show user_name and project_name instead of user_id and project_id - iniset $HIGGINS_CONF DEFAULT logging_context_format_string "%(asctime)s.%(msecs)03d %(levelname)s %(name)s [%(request_id)s %(user_name)s %(project_name)s] %(instance)s%(message)s" - fi - - # Register SSL certificates if provided - if is_ssl_enabled_service higgins; then - ensure_certificates higgins - - iniset $HIGGINS_CONF DEFAULT ssl_cert_file "$HIGGINS_SSL_CERT" - iniset $HIGGINS_CONF DEFAULT ssl_key_file "$HIGGINS_SSL_KEY" - - iniset $HIGGINS_CONF DEFAULT enabled_ssl_apis "$HIGGINS_ENABLED_APIS" - fi -} - -function create_api_paste_conf { - # copy api_paste.ini - cp $HIGGINS_DIR/etc/higgins/api-paste.ini $HIGGINS_API_PASTE -} - -# create_higgins_cache_dir() - Part of the init_HIGGINS() process -function create_higgins_cache_dir { - # Create cache dir - sudo mkdir -p $HIGGINS_AUTH_CACHE_DIR - sudo chown $STACK_USER $HIGGINS_AUTH_CACHE_DIR - rm -f $HIGGINS_AUTH_CACHE_DIR/* -} - - -# init_higgins() - Initialize databases, etc. -function init_higgins { - # Only do this step once on the API node for an entire cluster. - if is_service_enabled $DATABASE_BACKENDS && is_service_enabled higgins-api; then - # (Re)create higgins database - recreate_database higgins - - # Migrate higgins database - $HIGGINS_BIN_DIR/higgins-db-manage upgrade - fi - create_higgins_cache_dir -} - -# install_higginsclient() - Collect source and prepare -function install_higginsclient { - if use_library_from_git "python-higginsclient"; then - echo "we don't have CLI yet.." - #git_clone_by_name "python-higginsclient" - #setup_dev_lib "python-higginsclient" - fi -} - -# install_higgins() - Collect source and prepare -function install_higgins { - git_clone $HIGGINS_REPO $HIGGINS_DIR $HIGGINS_BRANCH - setup_develop $HIGGINS_DIR -} - -# start_higgins_api() - Start the API process ahead of other things -function start_higgins_api { - # Get right service port for testing - local service_port=$HIGGINS_SERVICE_PORT - local service_protocol=$HIGGINS_SERVICE_PROTOCOL - if is_service_enabled tls-proxy; then - service_port=$HIGGINS_SERVICE_PORT_INT - service_protocol="http" - fi - - run_process higgins-api "$HIGGINS_BIN_DIR/higgins-api" - echo "Waiting for higgins-api to start..." - if ! wait_for_service $SERVICE_TIMEOUT $service_protocol://$HIGGINS_SERVICE_HOST:$service_port; then - die $LINENO "higgins-api did not start" - fi - - # Start proxies if enabled - if is_service_enabled tls-proxy; then - start_tls_proxy '*' $HIGGINS_SERVICE_PORT $HIGGINS_SERVICE_HOST $HIGGINS_SERVICE_PORT_INT & - fi -} - - -# start_higgins() - Start running processes, including screen -function start_higgins { - - # ``run_process`` checks ``is_service_enabled``, it is not needed here - start_higgins_api - run_process higgins-conductor "$HIGGINS_BIN_DIR/higgins-conductor" -} - -# stop_higgins() - Stop running processes (non-screen) -function stop_higgins { - for serv in higgins-api higgins-conductor; do - stop_process $serv - done -} - - -# Restore xtrace -$XTRACE diff --git a/devstack/lib/zun b/devstack/lib/zun new file mode 100644 index 000000000..bf5cbfe9c --- /dev/null +++ b/devstack/lib/zun @@ -0,0 +1,268 @@ +#!/bin/bash +# +# lib/zun +# Functions to control the configuration and operation of the **zun** service + +# Dependencies: +# +# - ``functions`` file +# - ``DEST``, ``DATA_DIR``, ``STACK_USER`` must be defined +# - ``SERVICE_{TENANT_NAME|PASSWORD}`` must be defined + +# ``stack.sh`` calls the entry points in this order: +# +# - install_zun +# - configure_zun +# - create_zun_conf +# - create_zun_accounts +# - init_zun +# - start_zun +# - stop_zun +# - cleanup_zun + +# Save trace setting +XTRACE=$(set +o | grep xtrace) +set +o xtrace + + +# Defaults +# -------- + +# Set up default directories +ZUN_REPO=${ZUN_REPO:-${GIT_BASE}/openstack/higgins.git} +ZUN_BRANCH=${ZUN_BRANCH:-master} +ZUN_DIR=$DEST/higgins + +ZUN_STATE_PATH=${ZUN_STATE_PATH:=$DATA_DIR/zun} +ZUN_AUTH_CACHE_DIR=${ZUN_AUTH_CACHE_DIR:-/var/cache/zun} + +ZUN_CONF_DIR=/etc/zun +ZUN_CONF=$ZUN_CONF_DIR/zun.conf +ZUN_POLICY_JSON=$ZUN_CONF_DIR/policy.json +ZUN_API_PASTE=$ZUN_CONF_DIR/api-paste.ini + +if is_ssl_enabled_service "zun" || is_service_enabled tls-proxy; then + ZUN_SERVICE_PROTOCOL="https" +fi + +# Public facing bits +ZUN_SERVICE_HOST=${ZUN_SERVICE_HOST:-$HOST_IP} +ZUN_SERVICE_PORT=${ZUN_SERVICE_PORT:-9517} +ZUN_SERVICE_PORT_INT=${ZUN_SERVICE_PORT_INT:-19517} +ZUN_SERVICE_PROTOCOL=${ZUN_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL} + +ZUN_TRUSTEE_DOMAIN_ADMIN_PASSWORD=${ZUN_TRUSTEE_DOMAIN_ADMIN_PASSWORD:-secret} + +# Support entry points installation of console scripts +if [[ -d $ZUN_DIR/bin ]]; then + ZUN_BIN_DIR=$ZUN_DIR/bin +else + ZUN_BIN_DIR=$(get_python_exec_prefix) +fi + +# Functions +# --------- + +# Test if any zun services are enabled +# is_zun_enabled +function is_zun_enabled { + [[ ,${ENABLED_SERVICES} =~ ,"zun-" ]] && return 0 + return 1 +} +# cleanup_zun() - Remove residual data files, anything left over from previous +# runs that a clean run would need to clean up +function cleanup_zun { + sudo rm -rf $ZUN_STATE_PATH $ZUN_AUTH_CACHE_DIR +} + +# configure_zun() - Set config files, create data dirs, etc +function configure_zun { + # Put config files in ``/etc/zun`` for everyone to find + if [[ ! -d $ZUN_CONF_DIR ]]; then + sudo mkdir -p $ZUN_CONF_DIR + sudo chown $STACK_USER $ZUN_CONF_DIR + fi + + install_default_policy zun + # Rebuild the config file from scratch + create_zun_conf + + create_api_paste_conf + +} + +# create_zun_accounts() - Set up common required ZUN accounts +# +# Project User Roles +# ------------------------------------------------------------------ +# SERVICE_PROJECT_NAME zun service +function create_zun_accounts { + + create_service_user "zun" "admin" + + if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then + + local zun_service=$(get_or_create_service "zun" \ + "container" "Container As Service") + get_or_create_endpoint $zun_service \ + "$REGION_NAME" \ + "$ZUN_SERVICE_PROTOCOL://$ZUN_SERVICE_HOST:$ZUN_SERVICE_PORT/v1" \ + "$ZUN_SERVICE_PROTOCOL://$ZUN_SERVICE_HOST:$ZUN_SERVICE_PORT/v1" \ + "$ZUN_SERVICE_PROTOCOL://$ZUN_SERVICE_HOST:$ZUN_SERVICE_PORT/v1" + fi + +} + +# create_zun_conf() - Create a new zun.conf file +function create_zun_conf { + + # (Re)create ``zun.conf`` + rm -f $ZUN_CONF + iniset $ZUN_CONF DEFAULT debug "$ENABLE_DEBUG_LOG_LEVEL" + iniset $ZUN_CONF oslo_messaging_rabbit rabbit_userid $RABBIT_USERID + iniset $ZUN_CONF oslo_messaging_rabbit rabbit_password $RABBIT_PASSWORD + iniset $ZUN_CONF oslo_messaging_rabbit rabbit_host $RABBIT_HOST + + iniset $ZUN_CONF database connection `database_connection_url zun` + iniset $ZUN_CONF api host "$ZUN_SERVICE_HOST" + iniset $ZUN_CONF api port "$ZUN_SERVICE_PORT" + + iniset $ZUN_CONF oslo_policy policy_file $ZUN_POLICY_JSON + + iniset $ZUN_CONF keystone_auth auth_type password + iniset $ZUN_CONF keystone_auth username zun + iniset $ZUN_CONF keystone_auth password $SERVICE_PASSWORD + iniset $ZUN_CONF keystone_auth project_name $SERVICE_PROJECT_NAME + iniset $ZUN_CONF keystone_auth project_domain_id default + iniset $ZUN_CONF keystone_auth user_domain_id default + + # FIXME(pauloewerton): keystone_authtoken section is deprecated. Remove it + # after deprecation period. + iniset $ZUN_CONF keystone_authtoken admin_user zun + iniset $ZUN_CONF keystone_authtoken admin_password $SERVICE_PASSWORD + iniset $ZUN_CONF keystone_authtoken admin_tenant_name $SERVICE_PROJECT_NAME + + configure_auth_token_middleware $ZUN_CONF zun $ZUN_AUTH_CACHE_DIR + + iniset $ZUN_CONF keystone_auth auth_url $KEYSTONE_SERVICE_URI/v3 + iniset $ZUN_CONF keystone_authtoken auth_uri \ + ${KEYSTONE_SERVICE_PROTOCOL}://${HOST_IP}:${KEYSTONE_SERVICE_PORT}/v3 + iniset $ZUN_CONF keystone_authtoken auth_version v3 + + if is_fedora || is_suse; then + # zun defaults to /usr/local/bin, but fedora and suse pip like to + # install things in /usr/bin + iniset $ZUN_CONF DEFAULT bindir "/usr/bin" + fi + + if [ -n "$ZUN_STATE_PATH" ]; then + iniset $ZUN_CONF DEFAULT state_path "$ZUN_STATE_PATH" + iniset $ZUN_CONF oslo_concurrency lock_path "$ZUN_STATE_PATH" + fi + + if [ "$SYSLOG" != "False" ]; then + iniset $ZUN_CONF DEFAULT use_syslog "True" + fi + + # Format logging + if [ "$LOG_COLOR" == "True" ] && [ "$SYSLOG" == "False" ]; then + setup_colorized_logging $ZUN_CONF DEFAULT + else + # Show user_name and project_name instead of user_id and project_id + iniset $ZUN_CONF DEFAULT logging_context_format_string "%(asctime)s.%(msecs)03d %(levelname)s %(name)s [%(request_id)s %(user_name)s %(project_name)s] %(instance)s%(message)s" + fi + + # Register SSL certificates if provided + if is_ssl_enabled_service zun; then + ensure_certificates zun + + iniset $ZUN_CONF DEFAULT ssl_cert_file "$ZUN_SSL_CERT" + iniset $ZUN_CONF DEFAULT ssl_key_file "$ZUN_SSL_KEY" + + iniset $ZUN_CONF DEFAULT enabled_ssl_apis "$ZUN_ENABLED_APIS" + fi +} + +function create_api_paste_conf { + # copy api_paste.ini + cp $ZUN_DIR/etc/zun/api-paste.ini $ZUN_API_PASTE +} + +# create_zun_cache_dir() - Part of the init_ZUN() process +function create_zun_cache_dir { + # Create cache dir + sudo mkdir -p $ZUN_AUTH_CACHE_DIR + sudo chown $STACK_USER $ZUN_AUTH_CACHE_DIR + rm -f $ZUN_AUTH_CACHE_DIR/* +} + + +# init_zun() - Initialize databases, etc. +function init_zun { + # Only do this step once on the API node for an entire cluster. + if is_service_enabled $DATABASE_BACKENDS && is_service_enabled zun-api; then + # (Re)create zun database + recreate_database zun + + # Migrate zun database + $ZUN_BIN_DIR/zun-db-manage upgrade + fi + create_zun_cache_dir +} + +# install_zunclient() - Collect source and prepare +function install_zunclient { + if use_library_from_git "python-zunclient"; then + echo "we don't have CLI yet.." + #git_clone_by_name "python-zunclient" + #setup_dev_lib "python-zunclient" + fi +} + +# install_zun() - Collect source and prepare +function install_zun { + git_clone $ZUN_REPO $ZUN_DIR $ZUN_BRANCH + setup_develop $ZUN_DIR +} + +# start_zun_api() - Start the API process ahead of other things +function start_zun_api { + # Get right service port for testing + local service_port=$ZUN_SERVICE_PORT + local service_protocol=$ZUN_SERVICE_PROTOCOL + if is_service_enabled tls-proxy; then + service_port=$ZUN_SERVICE_PORT_INT + service_protocol="http" + fi + + run_process zun-api "$ZUN_BIN_DIR/zun-api" + echo "Waiting for zun-api to start..." + if ! wait_for_service $SERVICE_TIMEOUT $service_protocol://$ZUN_SERVICE_HOST:$service_port; then + die $LINENO "zun-api did not start" + fi + + # Start proxies if enabled + if is_service_enabled tls-proxy; then + start_tls_proxy '*' $ZUN_SERVICE_PORT $ZUN_SERVICE_HOST $ZUN_SERVICE_PORT_INT & + fi +} + + +# start_zun() - Start running processes, including screen +function start_zun { + + # ``run_process`` checks ``is_service_enabled``, it is not needed here + start_zun_api + run_process zun-conductor "$ZUN_BIN_DIR/zun-conductor" +} + +# stop_zun() - Stop running processes (non-screen) +function stop_zun { + for serv in zun-api zun-conductor; do + stop_process $serv + done +} + + +# Restore xtrace +$XTRACE diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 42b9c9a21..cfd419442 100755 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -1,47 +1,47 @@ -# higgins - Devstack extras script to install higgins +# zun - Devstack extras script to install zun # Save trace setting XTRACE=$(set +o | grep xtrace) set -o xtrace -echo_summary "higgins's plugin.sh was called..." -source $DEST/higgins/devstack/lib/higgins +echo_summary "zun's plugin.sh was called..." +source $DEST/higgins/devstack/lib/zun (set -o posix; set) -if is_service_enabled higgins-api higgins-conductor; then +if is_service_enabled zun-api zun-conductor; then if [[ "$1" == "stack" && "$2" == "install" ]]; then - echo_summary "Installing higgins" - install_higgins + echo_summary "Installing zun" + install_zun # TODO - # LIBS_FROM_GIT="${LIBS_FROM_GIT},python-higginsclient" - # install_higginsclient + # LIBS_FROM_GIT="${LIBS_FROM_GIT},python-zunclient" + # install_zunclient - cleanup_higgins + cleanup_zun elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then - echo_summary "Configuring higgins" - configure_higgins + echo_summary "Configuring zun" + configure_zun if is_service_enabled key; then - create_higgins_accounts + create_zun_accounts fi elif [[ "$1" == "stack" && "$2" == "extra" ]]; then - # Initialize higgins - init_higgins + # Initialize zun + init_zun - # Start the higgins API and higgins conductor - echo_summary "Starting higgins" - start_higgins + # Start the zun API and zun conductor + echo_summary "Starting zun" + start_zun fi if [[ "$1" == "unstack" ]]; then - stop_higgins + stop_zun fi if [[ "$1" == "clean" ]]; then - cleanup_higgins + cleanup_zun fi fi diff --git a/devstack/settings b/devstack/settings index d5303ed4f..7c81fb1f3 100644 --- a/devstack/settings +++ b/devstack/settings @@ -15,6 +15,6 @@ # PHYSICAL_NETWORK=public # OVS_PHYSICAL_BRIDGE=br-ex -# Enable Higgins services -enable_service higgins-api -enable_service higgins-conductor +# Enable Zun services +enable_service zun-api +enable_service zun-conductor diff --git a/doc/source/conf.py b/doc/source/conf.py index 86ee0021e..f081efa2b 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -36,7 +36,7 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -project = u'higgins' +project = u'zun' copyright = u'2013, OpenStack Foundation' # If true, '()' will be appended to :func: etc. cross-reference text. diff --git a/doc/source/dev/quickstart.rst b/doc/source/dev/quickstart.rst index 02033dfac..c8a44b106 100644 --- a/doc/source/dev/quickstart.rst +++ b/doc/source/dev/quickstart.rst @@ -4,7 +4,7 @@ Developer Quick-Start ===================== -This is a quick walkthrough to get you started developing code for Higgins. +This is a quick walkthrough to get you started developing code for Zun. This assumes you are already familiar with submitting code reviews to an OpenStack project. @@ -36,14 +36,14 @@ upgrade it individually, if you need to:: sudo pip install -U virtualenv -Higgins source code should be pulled directly from git:: +Zun source code should be pulled directly from git:: # from your home or source directory cd ~ git clone https://git.openstack.org/openstack/higgins - cd higgins + cd zun -All unit tests should be run using tox. To run Higgins's entire test suite:: +All unit tests should be run using tox. To run Zun's entire test suite:: # run all tests (unit and pep8) tox @@ -86,7 +86,7 @@ required OpenStack services:: SERVICE_TOKEN=password SERVICE_PASSWORD=password ADMIN_PASSWORD=password - # higgins requires the following to be set correctly + # zun requires the following to be set correctly PUBLIC_INTERFACE=eth1 END @@ -109,79 +109,79 @@ script:: source /opt/stack/devstack/openrc admin admin -Create a database in MySQL for higgins:: +Create a database in MySQL for zun:: mysql -h 127.0.0.1 -u root -ppassword mysql <=500 + - if an unhandled Exception or a ZunException with an error code >=500 is catched, raise a http 5xx ClientSideError and correlates it with a log message - - if a HigginsException is catched and its error code is <500, raise a http + - if a ZunException is catched and its error code is <500, raise a http 4xx and logs the excp in debug mode """ @@ -109,7 +109,7 @@ def wrap_controller_exception(func, func_server_error, func_client_error): try: return func(*args, **kw) except Exception as excp: - if isinstance(excp, HigginsException): + if isinstance(excp, ZunException): http_error_code = excp.code else: http_error_code = 500 @@ -162,7 +162,7 @@ def wrap_pecan_controller_exception(func): def wrap_keystone_exception(func): - """Wrap keystone exceptions and throw Higgins specific exceptions.""" + """Wrap keystone exceptions and throw Zun specific exceptions.""" @functools.wraps(func) def wrapped(*args, **kw): try: @@ -178,8 +178,8 @@ def wrap_keystone_exception(func): return wrapped -class HigginsException(Exception): - """Base Higgins Exception +class ZunException(Exception): + """Base Zun Exception To correctly use this class, inherit from it and define a 'message' property. That message will get printf'd @@ -212,7 +212,7 @@ class HigginsException(Exception): if CONF.oslo_versionedobjects.fatal_exception_format_errors: raise e - super(HigginsException, self).__init__(self.message) + super(ZunException, self).__init__(self.message) def __str__(self): if six.PY3: @@ -229,11 +229,11 @@ class HigginsException(Exception): return six.text_type(self) -class ObjectNotFound(HigginsException): +class ObjectNotFound(ZunException): message = _("The %(name)s %(id)s could not be found.") -class ObjectNotUnique(HigginsException): +class ObjectNotUnique(ZunException): message = _("The %(name)s already exists.") @@ -247,23 +247,23 @@ class ResourceExists(ObjectNotUnique): code = 409 -class AuthorizationFailure(HigginsException): +class AuthorizationFailure(ZunException): message = _("%(client)s connection failed. %(message)s") -class UnsupportedObjectError(HigginsException): +class UnsupportedObjectError(ZunException): message = _('Unsupported object type %(objtype)s') -class IncompatibleObjectVersion(HigginsException): +class IncompatibleObjectVersion(ZunException): message = _('Version %(objver)s of %(objname)s is not supported') -class OrphanedObjectError(HigginsException): +class OrphanedObjectError(ZunException): message = _('Cannot call %(method)s on orphaned %(objtype)s object') -class Invalid(HigginsException): +class Invalid(ZunException): message = _("Unacceptable parameters.") code = 400 @@ -281,7 +281,7 @@ class InvalidDiscoveryURL(Invalid): "discovery endpoint '%(discovery_endpoint)s'.") -class GetDiscoveryUrlFailed(HigginsException): +class GetDiscoveryUrlFailed(ZunException): message = _("Failed to get discovery url from '%(discovery_endpoint)s'.") @@ -301,7 +301,7 @@ class HTTPNotFound(ResourceNotFound): pass -class Conflict(HigginsException): +class Conflict(ZunException): message = _('Conflict.') code = 409 @@ -324,10 +324,10 @@ class PatchError(Invalid): message = _("Couldn't apply patch '%(patch)s'. Reason: %(reason)s") -class NotAuthorized(HigginsException): +class NotAuthorized(ZunException): message = _("Not authorized.") code = 403 -class ConfigInvalid(HigginsException): +class ConfigInvalid(ZunException): message = _("Invalid configuration file. %(error_msg)s") diff --git a/higgins/common/i18n.py b/zun/common/i18n.py similarity index 94% rename from higgins/common/i18n.py rename to zun/common/i18n.py index 4a2babf8f..ca46d9243 100644 --- a/higgins/common/i18n.py +++ b/zun/common/i18n.py @@ -19,7 +19,7 @@ import oslo_i18n -_translators = oslo_i18n.TranslatorFactory(domain='higgins') +_translators = oslo_i18n.TranslatorFactory(domain='zun') # The primary translation function using the well-known name "_" _ = _translators.primary diff --git a/higgins/common/keystone.py b/zun/common/keystone.py similarity index 97% rename from higgins/common/keystone.py rename to zun/common/keystone.py index 2b5986584..0b3ae9908 100644 --- a/higgins/common/keystone.py +++ b/zun/common/keystone.py @@ -18,8 +18,8 @@ from keystoneclient.v3 import client as kc_v3 from oslo_config import cfg from oslo_log import log as logging -from higgins.common import exception -from higgins.common.i18n import _LE +from zun.common import exception +from zun.common.i18n import _LE CONF = cfg.CONF CFG_GROUP = 'keystone_auth' diff --git a/higgins/common/rpc.py b/zun/common/rpc.py similarity index 88% rename from higgins/common/rpc.py rename to zun/common/rpc.py index 80e7fc326..61d4976af 100644 --- a/higgins/common/rpc.py +++ b/zun/common/rpc.py @@ -31,8 +31,8 @@ from oslo_config import cfg import oslo_messaging as messaging from oslo_serialization import jsonutils -from higgins.common import context as higgins_context -from higgins.common import exception +from zun.common import context as zun_context +from zun.common import exception CONF = cfg.CONF @@ -44,15 +44,15 @@ ALLOWED_EXMODS = [ ] EXTRA_EXMODS = [] -# NOTE(lucasagomes): The higgins.openstack.common.rpc entries are for +# NOTE(lucasagomes): The zun.openstack.common.rpc entries are for # backwards compat with IceHouse rpc_backend configuration values. TRANSPORT_ALIASES = { - 'higgins.openstack.common.rpc.impl_kombu': 'rabbit', - 'higgins.openstack.common.rpc.impl_qpid': 'qpid', - 'higgins.openstack.common.rpc.impl_zmq': 'zmq', - 'higgins.rpc.impl_kombu': 'rabbit', - 'higgins.rpc.impl_qpid': 'qpid', - 'higgins.rpc.impl_zmq': 'zmq', + 'zun.openstack.common.rpc.impl_kombu': 'rabbit', + 'zun.openstack.common.rpc.impl_qpid': 'qpid', + 'zun.openstack.common.rpc.impl_zmq': 'zmq', + 'zun.rpc.impl_kombu': 'rabbit', + 'zun.rpc.impl_qpid': 'qpid', + 'zun.rpc.impl_zmq': 'zmq', } @@ -115,7 +115,7 @@ class RequestContextSerializer(messaging.Serializer): return context.to_dict() def deserialize_context(self, context): - return higgins_context.RequestContext.from_dict(context) + return zun_context.RequestContext.from_dict(context) def get_transport_url(url_str=None): diff --git a/higgins/common/rpc_service.py b/zun/common/rpc_service.py similarity index 86% rename from higgins/common/rpc_service.py rename to zun/common/rpc_service.py index d0954f50a..e271416fb 100644 --- a/higgins/common/rpc_service.py +++ b/zun/common/rpc_service.py @@ -12,16 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Common RPC service and API tools for Higgins.""" +"""Common RPC service and API tools for Zun.""" import eventlet from oslo_config import cfg import oslo_messaging as messaging from oslo_service import service -from higgins.common import rpc -from higgins.objects import base as objects_base -from higgins.servicegroup import higgins_service_periodic as servicegroup +from zun.common import rpc +from zun.objects import base as objects_base +from zun.servicegroup import zun_service_periodic as servicegroup # NOTE(paulczar): # Ubuntu 14.04 forces librabbitmq when kombu is used @@ -31,12 +31,12 @@ from higgins.servicegroup import higgins_service_periodic as servicegroup eventlet.monkey_patch() # NOTE(asalkeld): -# The higgins.openstack.common.rpc entries are for compatibility +# The zun.openstack.common.rpc entries are for compatibility # with devstack rpc_backend configuration values. TRANSPORT_ALIASES = { - 'higgins.openstack.common.rpc.impl_kombu': 'rabbit', - 'higgins.openstack.common.rpc.impl_qpid': 'qpid', - 'higgins.openstack.common.rpc.impl_zmq': 'zmq', + 'zun.openstack.common.rpc.impl_kombu': 'rabbit', + 'zun.openstack.common.rpc.impl_qpid': 'qpid', + 'zun.openstack.common.rpc.impl_zmq': 'zmq', } periodic_opts = [ @@ -55,7 +55,7 @@ class Service(service.Service): def __init__(self, topic, server, handlers, binary): super(Service, self).__init__() serializer = rpc.RequestContextSerializer( - objects_base.HigginsObjectSerializer()) + objects_base.ZunObjectSerializer()) transport = messaging.get_transport(cfg.CONF, aliases=TRANSPORT_ALIASES) # TODO(asalkeld) add support for version='x.y' @@ -84,7 +84,7 @@ class API(object): def __init__(self, transport=None, context=None, topic=None, server=None, timeout=None): serializer = rpc.RequestContextSerializer( - objects_base.HigginsObjectSerializer()) + objects_base.ZunObjectSerializer()) if transport is None: exmods = rpc.get_allowed_exmods() transport = messaging.get_transport(cfg.CONF, diff --git a/higgins/common/safe_utils.py b/zun/common/safe_utils.py similarity index 100% rename from higgins/common/safe_utils.py rename to zun/common/safe_utils.py diff --git a/higgins/common/service.py b/zun/common/service.py similarity index 93% rename from higgins/common/service.py rename to zun/common/service.py index e34304e8e..c91633f3e 100644 --- a/higgins/common/service.py +++ b/zun/common/service.py @@ -22,10 +22,10 @@ from oslo_log import log from oslo_service import service from oslo_service import wsgi -from higgins.api import app -from higgins.common import config -from higgins.common import exception -from higgins.common.i18n import _ +from zun.api import app +from zun.common import config +from zun.common import exception +from zun.common.i18n import _ service_opts = [ @@ -49,7 +49,7 @@ def prepare_service(argv=None): argv = [] log.register_options(CONF) config.parse_args(argv) - log.setup(CONF, 'higgins') + log.setup(CONF, 'zun') # TODO(yuanying): Uncomment after objects are implemented # objects.register_all() @@ -59,7 +59,7 @@ def process_launcher(): class WSGIService(service.ServiceBase): - """Provides ability to launch Higgins API from wsgi app.""" + """Provides ability to launch Zun API from wsgi app.""" def __init__(self, name, use_ssl=False): """Initialize, but do not start the WSGI server. diff --git a/higgins/common/short_id.py b/zun/common/short_id.py similarity index 98% rename from higgins/common/short_id.py rename to zun/common/short_id.py index 720c44a7c..6894ffdb9 100644 --- a/higgins/common/short_id.py +++ b/zun/common/short_id.py @@ -20,7 +20,7 @@ import uuid import six -from higgins.common.i18n import _ +from zun.common.i18n import _ def _to_byte_string(value, num_bits): diff --git a/higgins/common/utils.py b/zun/common/utils.py similarity index 98% rename from higgins/common/utils.py rename to zun/common/utils.py index d912101f1..9ea8d2d63 100644 --- a/higgins/common/utils.py +++ b/zun/common/utils.py @@ -20,7 +20,7 @@ from oslo_log import log as logging import six import uuid -from higgins.common.i18n import _LW +from zun.common.i18n import _LW LOG = logging.getLogger(__name__) diff --git a/higgins/common/yamlutils.py b/zun/common/yamlutils.py similarity index 100% rename from higgins/common/yamlutils.py rename to zun/common/yamlutils.py diff --git a/higgins/conductor/__init__.py b/zun/conductor/__init__.py similarity index 100% rename from higgins/conductor/__init__.py rename to zun/conductor/__init__.py diff --git a/higgins/conductor/api.py b/zun/conductor/api.py similarity index 88% rename from higgins/conductor/api.py rename to zun/conductor/api.py index 49a7597f1..8a8eeb650 100644 --- a/higgins/conductor/api.py +++ b/zun/conductor/api.py @@ -10,10 +10,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""API for interfacing with Higgins Backend.""" +"""API for interfacing with Zun Backend.""" from oslo_config import cfg -from higgins.common import rpc_service +from zun.common import rpc_service # The Backend API class serves as a AMQP client for communicating @@ -23,7 +23,7 @@ from higgins.common import rpc_service class API(rpc_service.API): def __init__(self, transport=None, context=None, topic=None): if topic is None: - cfg.CONF.import_opt('topic', 'higgins.conductor.config', + cfg.CONF.import_opt('topic', 'zun.conductor.config', group='conductor') super(API, self).__init__(transport, context, topic=cfg.CONF.conductor.topic) diff --git a/higgins/conductor/config.py b/zun/conductor/config.py similarity index 84% rename from higgins/conductor/config.py rename to zun/conductor/config.py index ef370d6ef..ac4ad2e0e 100644 --- a/higgins/conductor/config.py +++ b/zun/conductor/config.py @@ -10,19 +10,19 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Config options for Higgins Backend service.""" +"""Config options for Zun Backend service.""" from oslo_config import cfg SERVICE_OPTS = [ cfg.StrOpt('topic', - default='higgins-conductor', + default='zun-conductor', help='The queue to add conductor tasks to.'), ] opt_group = cfg.OptGroup( name='conductor', - title='Options for the higgins-conductor service') + title='Options for the zun-conductor service') cfg.CONF.register_group(opt_group) cfg.CONF.register_opts(SERVICE_OPTS, opt_group) diff --git a/higgins/conductor/handlers/__init__.py b/zun/conductor/handlers/__init__.py similarity index 100% rename from higgins/conductor/handlers/__init__.py rename to zun/conductor/handlers/__init__.py diff --git a/higgins/conductor/handlers/default.py b/zun/conductor/handlers/default.py similarity index 95% rename from higgins/conductor/handlers/default.py rename to zun/conductor/handlers/default.py index 75f56fdd0..d112033d9 100644 --- a/higgins/conductor/handlers/default.py +++ b/zun/conductor/handlers/default.py @@ -10,7 +10,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Higgins Conductor default handler.""" +"""Zun Conductor default handler.""" # These are the database operations - They are executed by the conductor diff --git a/higgins/db/__init__.py b/zun/db/__init__.py similarity index 100% rename from higgins/db/__init__.py rename to zun/db/__init__.py diff --git a/higgins/db/api.py b/zun/db/api.py similarity index 64% rename from higgins/db/api.py rename to zun/db/api.py index b76d4d46f..18c040da0 100644 --- a/higgins/db/api.py +++ b/zun/db/api.py @@ -22,7 +22,7 @@ from oslo_db import api as db_api import six -_BACKEND_MAPPING = {'sqlalchemy': 'higgins.db.sqlalchemy.api'} +_BACKEND_MAPPING = {'sqlalchemy': 'zun.db.sqlalchemy.api'} IMPL = db_api.DBAPI.from_config(cfg.CONF, backend_mapping=_BACKEND_MAPPING, lazy=True) @@ -41,49 +41,49 @@ class Connection(object): """Constructor.""" @abc.abstractmethod - def destroy_higgins_service(self, higgins_service_id): - """Destroys a higgins_service record. + def destroy_zun_service(self, zun_service_id): + """Destroys a zun_service record. - :param higgins_service_id: The id of a higgins_service. + :param zun_service_id: The id of a zun_service. """ @abc.abstractmethod - def update_higgins_service(self, higgins_service_id, values): - """Update properties of a higgins_service. + def update_zun_service(self, zun_service_id, values): + """Update properties of a zun_service. - :param higgins_service_id: The id of a higgins_service record. + :param zun_service_id: The id of a zun_service record. """ @abc.abstractmethod - def get_higgins_service_by_host_and_binary(self, context, host, binary): - """Return a higgins_service record. + def get_zun_service_by_host_and_binary(self, context, host, binary): + """Return a zun_service record. :param context: The security context :param host: The host where the binary is located. :param binary: The name of the binary. - :returns: A higgins_service record. + :returns: A zun_service record. """ @abc.abstractmethod - def create_higgins_service(self, values): - """Create a new higgins_service record. + def create_zun_service(self, values): + """Create a new zun_service record. :param values: A dict containing several items used to identify - and define the higgins_service record. - :returns: A higgins_service record. + and define the zun_service record. + :returns: A zun_service record. """ @abc.abstractmethod - def get_higgins_service_list(self, context, disabled=None, limit=None, - marker=None, sort_key=None, sort_dir=None): - """Get matching higgins_service records. + def get_zun_service_list(self, context, disabled=None, limit=None, + marker=None, sort_key=None, sort_dir=None): + """Get matching zun_service records. - Return a list of the specified columns for all higgins_services + Return a list of the specified columns for all zun_services those match the specified filters. :param context: The security context :param disabled: Filters disbaled services. Defaults to None. - :param limit: Maximum number of higgins_services to return. + :param limit: Maximum number of zun_services to return. :param marker: the last item of the previous page; we return the next result set. :param sort_key: Attribute by which results should be sorted. diff --git a/higgins/db/migration.py b/zun/db/migration.py similarity index 94% rename from higgins/db/migration.py rename to zun/db/migration.py index 865224525..ad0214508 100644 --- a/higgins/db/migration.py +++ b/zun/db/migration.py @@ -23,7 +23,7 @@ def get_backend(): global _IMPL if not _IMPL: cfg.CONF.import_opt('backend', 'oslo_db.options', group='database') - _IMPL = driver.DriverManager("higgins.database.migration_backend", + _IMPL = driver.DriverManager("zun.database.migration_backend", cfg.CONF.database.backend).driver return _IMPL diff --git a/higgins/db/sqlalchemy/__init__.py b/zun/db/sqlalchemy/__init__.py similarity index 100% rename from higgins/db/sqlalchemy/__init__.py rename to zun/db/sqlalchemy/__init__.py diff --git a/higgins/db/sqlalchemy/alembic.ini b/zun/db/sqlalchemy/alembic.ini similarity index 100% rename from higgins/db/sqlalchemy/alembic.ini rename to zun/db/sqlalchemy/alembic.ini diff --git a/higgins/db/sqlalchemy/alembic/README b/zun/db/sqlalchemy/alembic/README similarity index 57% rename from higgins/db/sqlalchemy/alembic/README rename to zun/db/sqlalchemy/alembic/README index a392eb2c7..16e86c6d5 100644 --- a/higgins/db/sqlalchemy/alembic/README +++ b/zun/db/sqlalchemy/alembic/README @@ -1,11 +1,11 @@ Please see https://alembic.readthedocs.org/en/latest/index.html for general documentation To create alembic migrations use: -$ higgins-db-manage revision --message "description of revision" --autogenerate +$ zun-db-manage revision --message "description of revision" --autogenerate Stamp db with most recent migration version, without actually running migrations -$ higgins-db-manage stamp head +$ zun-db-manage stamp head Upgrade can be performed by: -$ higgins-db-manage upgrade -$ higgins-db-manage upgrade head +$ zun-db-manage upgrade +$ zun-db-manage upgrade head diff --git a/higgins/db/sqlalchemy/alembic/env.py b/zun/db/sqlalchemy/alembic/env.py similarity index 95% rename from higgins/db/sqlalchemy/alembic/env.py rename to zun/db/sqlalchemy/alembic/env.py index 57e9a6202..3d5123e50 100644 --- a/higgins/db/sqlalchemy/alembic/env.py +++ b/zun/db/sqlalchemy/alembic/env.py @@ -15,8 +15,8 @@ from __future__ import with_statement from alembic import context from logging.config import fileConfig -from higgins.db.sqlalchemy import api as sqla_api -from higgins.db.sqlalchemy import models +from zun.db.sqlalchemy import api as sqla_api +from zun.db.sqlalchemy import models # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config diff --git a/higgins/db/sqlalchemy/alembic/script.py.mako b/zun/db/sqlalchemy/alembic/script.py.mako similarity index 100% rename from higgins/db/sqlalchemy/alembic/script.py.mako rename to zun/db/sqlalchemy/alembic/script.py.mako diff --git a/higgins/db/sqlalchemy/alembic/versions/a9a92eebd9a8_create_table_higgins_service.py b/zun/db/sqlalchemy/alembic/versions/a9a92eebd9a8_create_table_higgins_service.py similarity index 92% rename from higgins/db/sqlalchemy/alembic/versions/a9a92eebd9a8_create_table_higgins_service.py rename to zun/db/sqlalchemy/alembic/versions/a9a92eebd9a8_create_table_higgins_service.py index 3d7b65601..4b7846464 100644 --- a/higgins/db/sqlalchemy/alembic/versions/a9a92eebd9a8_create_table_higgins_service.py +++ b/zun/db/sqlalchemy/alembic/versions/a9a92eebd9a8_create_table_higgins_service.py @@ -11,7 +11,7 @@ # under the License. -"""create_table_higgins_service +"""create_table_zun_service Revision ID: a9a92eebd9a8 Revises: @@ -31,7 +31,7 @@ import sqlalchemy as sa def upgrade(): op.create_table( - 'higgins_service', + 'zun_service', sa.Column('id', sa.Integer(), nullable=False), sa.Column('created_at', sa.DateTime(), nullable=True), sa.Column('updated_at', sa.DateTime(), nullable=True), @@ -44,5 +44,5 @@ def upgrade(): sa.Column('forced_down', sa.Boolean(), nullable=True), sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('host', 'binary', - name='uniq_higgins_service0host0binary') + name='uniq_zun_service0host0binary') ) diff --git a/higgins/db/sqlalchemy/api.py b/zun/db/sqlalchemy/api.py similarity index 72% rename from higgins/db/sqlalchemy/api.py rename to zun/db/sqlalchemy/api.py index 095ece836..bcbbb10a0 100644 --- a/higgins/db/sqlalchemy/api.py +++ b/zun/db/sqlalchemy/api.py @@ -21,11 +21,11 @@ from oslo_db.sqlalchemy import utils as db_utils from oslo_utils import timeutils from sqlalchemy.orm.exc import NoResultFound -from higgins.common import exception -from higgins.common.i18n import _ -from higgins.common import utils -from higgins.db import api -from higgins.db.sqlalchemy import models +from zun.common import exception +from zun.common.i18n import _ +from zun.common import utils +from zun.db import api +from zun.db.sqlalchemy import models CONF = cfg.CONF @@ -107,24 +107,24 @@ class Connection(api.Connection): def __init__(self): pass - def destroy_higgins_service(self, higgins_service_id): + def destroy_zun_service(self, zun_service_id): session = get_session() with session.begin(): - query = model_query(models.HigginsService, session=session) - query = add_identity_filter(query, higgins_service_id) + query = model_query(models.ZunService, session=session) + query = add_identity_filter(query, zun_service_id) count = query.delete() if count != 1: - raise exception.HigginsServiceNotFound(higgins_service_id) + raise exception.ZunServiceNotFound(zun_service_id) - def update_higgins_service(self, higgins_service_id, values): + def update_zun_service(self, zun_service_id, values): session = get_session() with session.begin(): - query = model_query(models.HigginsService, session=session) - query = add_identity_filter(query, higgins_service_id) + query = model_query(models.ZunService, session=session) + query = add_identity_filter(query, zun_service_id) try: ref = query.with_lockmode('update').one() except NoResultFound: - raise exception.HigginsServiceNotFound(higgins_service_id) + raise exception.ZunServiceNotFound(zun_service_id) if 'report_count' in values: if values['report_count'] > ref.report_count: @@ -133,30 +133,30 @@ class Connection(api.Connection): ref.update(values) return ref - def get_higgins_service_by_host_and_binary(self, context, host, binary): - query = model_query(models.HigginsService) + def get_zun_service_by_host_and_binary(self, context, host, binary): + query = model_query(models.ZunService) query = query.filter_by(host=host, binary=binary) try: return query.one() except NoResultFound: return None - def create_higgins_service(self, values): - higgins_service = models.HigginsService() - higgins_service.update(values) + def create_zun_service(self, values): + zun_service = models.ZunService() + zun_service.update(values) try: - higgins_service.save() + zun_service.save() except db_exc.DBDuplicateEntry: - raise exception.HigginsServiceAlreadyExists( - id=higgins_service['id']) - return higgins_service + raise exception.ZunServiceAlreadyExists( + id=zun_service['id']) + return zun_service - def get_higgins_service_list(self, context, disabled=None, limit=None, - marker=None, sort_key=None, sort_dir=None - ): - query = model_query(models.HigginsService) + def get_zun_service_list(self, context, disabled=None, limit=None, + marker=None, sort_key=None, sort_dir=None + ): + query = model_query(models.ZunService) if disabled: query = query.filter_by(disabled=disabled) - return _paginate_query(models.HigginsService, limit, marker, + return _paginate_query(models.ZunService, limit, marker, sort_key, sort_dir, query) diff --git a/higgins/db/sqlalchemy/migration.py b/zun/db/sqlalchemy/migration.py similarity index 100% rename from higgins/db/sqlalchemy/migration.py rename to zun/db/sqlalchemy/migration.py diff --git a/higgins/db/sqlalchemy/models.py b/zun/db/sqlalchemy/models.py similarity index 88% rename from higgins/db/sqlalchemy/models.py rename to zun/db/sqlalchemy/models.py index ced6748b5..a31769ec6 100644 --- a/higgins/db/sqlalchemy/models.py +++ b/zun/db/sqlalchemy/models.py @@ -73,8 +73,8 @@ class JSONEncodedList(JsonEncodedType): type = list -class HigginsBase(models.TimestampMixin, - models.ModelBase): +class ZunBase(models.TimestampMixin, + models.ModelBase): metadata = None @@ -85,23 +85,23 @@ class HigginsBase(models.TimestampMixin, return d def save(self, session=None): - import higgins.db.sqlalchemy.api as db_api + import zun.db.sqlalchemy.api as db_api if session is None: session = db_api.get_session() - super(HigginsBase, self).save(session) + super(ZunBase, self).save(session) -Base = declarative_base(cls=HigginsBase) +Base = declarative_base(cls=ZunBase) -class HigginsService(Base): - """Represents health status of various higgins services""" - __tablename__ = 'higgins_service' +class ZunService(Base): + """Represents health status of various zun services""" + __tablename__ = 'zun_service' __table_args__ = ( schema.UniqueConstraint("host", "binary", - name="uniq_higgins_service0host0binary"), + name="uniq_zun_service0host0binary"), table_args() ) diff --git a/higgins/hacking/__init__.py b/zun/hacking/__init__.py similarity index 100% rename from higgins/hacking/__init__.py rename to zun/hacking/__init__.py diff --git a/higgins/hacking/checks.py b/zun/hacking/checks.py similarity index 97% rename from higgins/hacking/checks.py rename to zun/hacking/checks.py index 2ca38e5f3..91d97192b 100644 --- a/higgins/hacking/checks.py +++ b/zun/hacking/checks.py @@ -18,7 +18,7 @@ import re """ Guidelines for writing new hacking checks - - Use only for Higgins specific tests. OpenStack general tests + - Use only for Zun specific tests. OpenStack general tests should be submitted to the common 'hacking' module. - Pick numbers in the range M3xx. Find the current test with the highest allocated number and then pick the next value. @@ -26,7 +26,7 @@ Guidelines for writing new hacking checks - Keep the test method code in the source file ordered based on the M3xx value. - List the new rule in the top level HACKING.rst file - - Add test cases for each new rule to higgins/tests/unit/test_hacking.py + - Add test cases for each new rule to zun/tests/unit/test_hacking.py """ diff --git a/higgins/objects/__init__.py b/zun/objects/__init__.py similarity index 82% rename from higgins/objects/__init__.py rename to zun/objects/__init__.py index 1747ddabc..5342b1ea1 100644 --- a/higgins/objects/__init__.py +++ b/zun/objects/__init__.py @@ -11,9 +11,9 @@ # under the License. -from higgins.objects import higgins_service +from zun.objects import zun_service -HigginsService = higgins_service.HigginsService +ZunService = zun_service.ZunService -__all__ = (HigginsService,) +__all__ = (ZunService,) diff --git a/higgins/objects/base.py b/zun/objects/base.py similarity index 80% rename from higgins/objects/base.py rename to zun/objects/base.py index 2002df29e..50ce3a30b 100644 --- a/higgins/objects/base.py +++ b/zun/objects/base.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -"""Higgins common internal object model""" +"""Zun common internal object model""" from oslo_versionedobjects import base as ovoo_base from oslo_versionedobjects import fields as ovoo_fields @@ -22,11 +22,11 @@ remotable_classmethod = ovoo_base.remotable_classmethod remotable = ovoo_base.remotable -class HigginsObjectRegistry(ovoo_base.VersionedObjectRegistry): +class ZunObjectRegistry(ovoo_base.VersionedObjectRegistry): pass -class HigginsObject(ovoo_base.VersionedObject): +class ZunObject(ovoo_base.VersionedObject): """Base class and object factory. This forms the base of all objects that can be remoted or instantiated @@ -35,7 +35,7 @@ class HigginsObject(ovoo_base.VersionedObject): necessary "get" classmethod routines as well as "save" object methods as appropriate. """ - OBJ_PROJECT_NAMESPACE = 'higgins' + OBJ_PROJECT_NAMESPACE = 'zun' def as_dict(self): return {k: getattr(self, k) @@ -43,11 +43,11 @@ class HigginsObject(ovoo_base.VersionedObject): if self.obj_attr_is_set(k)} -class HigginsObjectDictCompat(ovoo_base.VersionedObjectDictCompat): +class ZunObjectDictCompat(ovoo_base.VersionedObjectDictCompat): pass -class HigginsPersistentObject(object): +class ZunPersistentObject(object): """Mixin class for Persistent objects. This adds the fields that we use in common for all persistent objects. @@ -58,6 +58,6 @@ class HigginsPersistentObject(object): } -class HigginsObjectSerializer(ovoo_base.VersionedObjectSerializer): +class ZunObjectSerializer(ovoo_base.VersionedObjectSerializer): # Base class to use for object hydration - OBJ_BASE_CLASS = HigginsObject + OBJ_BASE_CLASS = ZunObject diff --git a/higgins/objects/higgins_service.py b/zun/objects/zun_service.py similarity index 68% rename from higgins/objects/higgins_service.py rename to zun/objects/zun_service.py index 23d095529..c34bd4422 100644 --- a/higgins/objects/higgins_service.py +++ b/zun/objects/zun_service.py @@ -12,13 +12,13 @@ from oslo_versionedobjects import fields -from higgins.db import api as dbapi -from higgins.objects import base +from zun.db import api as dbapi +from zun.objects import base -@base.HigginsObjectRegistry.register -class HigginsService(base.HigginsPersistentObject, base.HigginsObject, - base.HigginsObjectDictCompat): +@base.ZunObjectRegistry.register +class ZunService(base.ZunPersistentObject, base.ZunObject, + base.ZunObjectDictCompat): # Version 1.0: Initial version VERSION = '1.0' @@ -36,88 +36,88 @@ class HigginsService(base.HigginsPersistentObject, base.HigginsObject, } @staticmethod - def _from_db_object(higgins_service, db_higgins_service): + def _from_db_object(zun_service, db_zun_service): """Converts a database entity to a formal object.""" - for field in higgins_service.fields: - higgins_service[field] = db_higgins_service[field] + for field in zun_service.fields: + zun_service[field] = db_zun_service[field] - higgins_service.obj_reset_changes() - return higgins_service + zun_service.obj_reset_changes() + return zun_service @staticmethod def _from_db_object_list(db_objects, cls, context): """Converts a list of database entities to a list of formal objects.""" - return [HigginsService._from_db_object(cls(context), obj) + return [ZunService._from_db_object(cls(context), obj) for obj in db_objects] @base.remotable_classmethod def get_by_host_and_binary(cls, context, host, binary): - """Find a higgins_service based on its hostname and binary. + """Find a zun_service based on its hostname and binary. :param host: The host on which the binary is running. :param binary: The name of the binary. :param context: Security context. - :returns: a :class:`HigginsService` object. + :returns: a :class:`ZunService` object. """ - db_higgins_service = cls.dbapi.get_higgins_service_by_host_and_binary( + db_zun_service = cls.dbapi.get_zun_service_by_host_and_binary( context, host, binary) - if db_higgins_service is None: + if db_zun_service is None: return None - higgins_service = HigginsService._from_db_object( - cls(context), db_higgins_service) - return higgins_service + zun_service = ZunService._from_db_object( + cls(context), db_zun_service) + return zun_service @base.remotable_classmethod def list(cls, context, limit=None, marker=None, sort_key=None, sort_dir=None): - """Return a list of HigginsService objects. + """Return a list of ZunService objects. :param context: Security context. :param limit: maximum number of resources to return in a single result. :param marker: pagination marker for large data sets. :param sort_key: column to sort results by. :param sort_dir: direction to sort. "asc" or "desc". - :returns: a list of :class:`HigginsService` object. + :returns: a list of :class:`ZunService` object. """ - db_higgins_services = cls.dbapi.get_higgins_service_list( + db_zun_services = cls.dbapi.get_zun_service_list( context, limit=limit, marker=marker, sort_key=sort_key, sort_dir=sort_dir) - return HigginsService._from_db_object_list(db_higgins_services, cls, - context) + return ZunService._from_db_object_list(db_zun_services, cls, + context) @base.remotable def create(self, context=None): - """Create a HigginsService record in the DB. + """Create a ZunService record in the DB. :param context: Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don't use it. A context should be set when instantiating the - object, e.g.: HigginsService(context) + object, e.g.: ZunService(context) """ values = self.obj_get_changes() - db_higgins_service = self.dbapi.create_higgins_service(values) - self._from_db_object(self, db_higgins_service) + db_zun_service = self.dbapi.create_zun_service(values) + self._from_db_object(self, db_zun_service) @base.remotable def destroy(self, context=None): - """Delete the HigginsService from the DB. + """Delete the ZunService from the DB. :param context: Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don't use it. A context should be set when instantiating the - object, e.g.: HigginsService(context) + object, e.g.: ZunService(context) """ - self.dbapi.destroy_higgins_service(self.id) + self.dbapi.destroy_zun_service(self.id) self.obj_reset_changes() @base.remotable def save(self, context=None): - """Save updates to this HigginsService. + """Save updates to this ZunService. Updates will be made column by column based on the result of self.what_changed(). @@ -127,22 +127,22 @@ class HigginsService(base.HigginsPersistentObject, base.HigginsObject, Unfortunately, RPC requires context as the first argument, even though we don't use it. A context should be set when instantiating the - object, e.g.: HigginsService(context) + object, e.g.: ZunService(context) """ updates = self.obj_get_changes() - self.dbapi.update_higgins_service(self.id, updates) + self.dbapi.update_zun_service(self.id, updates) self.obj_reset_changes() @base.remotable def report_state_up(self, context=None): - """Touching the higgins_service record to show aliveness. + """Touching the zun_service record to show aliveness. :param context: Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don't use it. A context should be set when instantiating the - object, e.g.: HigginsService(context) + object, e.g.: ZunService(context) """ self.report_count += 1 self.save() diff --git a/higgins/opts.py b/zun/opts.py similarity index 60% rename from higgins/opts.py rename to zun/opts.py index 0dc11acc4..733b241f6 100644 --- a/higgins/opts.py +++ b/zun/opts.py @@ -12,21 +12,21 @@ import itertools -import higgins.api.app -import higgins.common.keystone -import higgins.common.rpc_service -import higgins.common.service -import higgins.conductor.config +import zun.api.app +import zun.common.keystone +import zun.common.rpc_service +import zun.common.service +import zun.conductor.config def list_opts(): return [ ('DEFAULT', itertools.chain( - higgins.common.rpc_service.periodic_opts, - higgins.common.service.service_opts, + zun.common.rpc_service.periodic_opts, + zun.common.service.service_opts, )), - ('api', higgins.api.app.API_SERVICE_OPTS), - ('conductor', higgins.conductor.config.SERVICE_OPTS), - ('keystone_auth', higgins.common.keystone.keystone_auth_opts), + ('api', zun.api.app.API_SERVICE_OPTS), + ('conductor', zun.conductor.config.SERVICE_OPTS), + ('keystone_auth', zun.common.keystone.keystone_auth_opts), ] diff --git a/higgins/service/__init__.py b/zun/service/__init__.py similarity index 100% rename from higgins/service/__init__.py rename to zun/service/__init__.py diff --git a/higgins/service/periodic.py b/zun/service/periodic.py similarity index 95% rename from higgins/service/periodic.py rename to zun/service/periodic.py index 6363149e8..631465f54 100644 --- a/higgins/service/periodic.py +++ b/zun/service/periodic.py @@ -13,7 +13,7 @@ import functools -from higgins.common import context +from zun.common import context def set_context(func): diff --git a/higgins/servicegroup/__init__.py b/zun/servicegroup/__init__.py similarity index 100% rename from higgins/servicegroup/__init__.py rename to zun/servicegroup/__init__.py diff --git a/higgins/servicegroup/higgins_service_periodic.py b/zun/servicegroup/zun_service_periodic.py similarity index 58% rename from higgins/servicegroup/higgins_service_periodic.py rename to zun/servicegroup/zun_service_periodic.py index bb4e0e710..db8387ad7 100644 --- a/higgins/servicegroup/higgins_service_periodic.py +++ b/zun/servicegroup/zun_service_periodic.py @@ -10,51 +10,51 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Higgins Service Layer""" +"""Zun Service Layer""" from oslo_log import log from oslo_service import periodic_task -from higgins import objects -from higgins.service import periodic +from zun import objects +from zun.service import periodic LOG = log.getLogger(__name__) -class HigginsServicePeriodicTasks(periodic_task.PeriodicTasks): - '''Higgins periodic Task class +class ZunServicePeriodicTasks(periodic_task.PeriodicTasks): + '''Zun periodic Task class Any periodic task job need to be added into this class ''' def __init__(self, conf, binary): - self.higgins_service_ref = None + self.zun_service_ref = None self.host = conf.host self.binary = binary - super(HigginsServicePeriodicTasks, self).__init__(conf) + super(ZunServicePeriodicTasks, self).__init__(conf) @periodic_task.periodic_task(run_immediately=True) @periodic.set_context - def update_higgins_service(self, ctx): - LOG.debug('Update higgins_service') - if self.higgins_service_ref is None: - self.higgins_service_ref = \ - objects.HigginsService.get_by_host_and_binary( + def update_zun_service(self, ctx): + LOG.debug('Update zun_service') + if self.zun_service_ref is None: + self.zun_service_ref = \ + objects.ZunService.get_by_host_and_binary( ctx, self.host, self.binary) - if self.higgins_service_ref is None: - higgins_service_dict = { + if self.zun_service_ref is None: + zun_service_dict = { 'host': self.host, 'binary': self.binary } - self.higgins_service_ref = objects.HigginsService( - ctx, **higgins_service_dict) - self.higgins_service_ref.create() - self.higgins_service_ref.report_state_up() + self.zun_service_ref = objects.ZunService( + ctx, **zun_service_dict) + self.zun_service_ref.create() + self.zun_service_ref.report_state_up() def setup(conf, binary, tg): - pt = HigginsServicePeriodicTasks(conf, binary) + pt = ZunServicePeriodicTasks(conf, binary) tg.add_dynamic_timer( pt.run_periodic_tasks, periodic_interval_max=conf.periodic_interval_max, diff --git a/higgins/tests/__init__.py b/zun/tests/__init__.py similarity index 100% rename from higgins/tests/__init__.py rename to zun/tests/__init__.py diff --git a/higgins/tests/base.py b/zun/tests/base.py similarity index 96% rename from higgins/tests/base.py rename to zun/tests/base.py index ff9dc411c..e54bf930f 100644 --- a/higgins/tests/base.py +++ b/zun/tests/base.py @@ -17,7 +17,7 @@ from oslo_config import cfg from oslo_log import log from oslotest import base -from higgins.tests import conf_fixture +from zun.tests import conf_fixture CONF = cfg.CONF diff --git a/higgins/tests/conf_fixture.py b/zun/tests/conf_fixture.py similarity index 91% rename from higgins/tests/conf_fixture.py rename to zun/tests/conf_fixture.py index 061387b6f..60f68462e 100644 --- a/higgins/tests/conf_fixture.py +++ b/zun/tests/conf_fixture.py @@ -17,10 +17,10 @@ import fixtures from oslo_config import cfg -# from higgins.common import config +# from zun.common import config CONF = cfg.CONF -CONF.import_opt('host', 'higgins.common.service') +CONF.import_opt('host', 'zun.common.service') class ConfFixture(fixtures.Fixture): diff --git a/higgins/tests/unit/__init__.py b/zun/tests/unit/__init__.py similarity index 100% rename from higgins/tests/unit/__init__.py rename to zun/tests/unit/__init__.py diff --git a/higgins/tests/unit/servicegroup/__init__.py b/zun/tests/unit/servicegroup/__init__.py similarity index 100% rename from higgins/tests/unit/servicegroup/__init__.py rename to zun/tests/unit/servicegroup/__init__.py diff --git a/zun/tests/unit/servicegroup/test_zun_service.py b/zun/tests/unit/servicegroup/test_zun_service.py new file mode 100644 index 000000000..64b8e1780 --- /dev/null +++ b/zun/tests/unit/servicegroup/test_zun_service.py @@ -0,0 +1,73 @@ +# 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. + +import mock + +from zun.common.rpc_service import CONF +from zun import objects +from zun.servicegroup import zun_service_periodic as periodic +from zun.tests import base + + +class ZunServicePeriodicTestCase(base.BaseTestCase): + def setUp(self): + super(ZunServicePeriodicTestCase, self).setUp() + mock_zun_service_refresh = mock.Mock() + + class FakeSrv(object): + report_state_up = mock_zun_service_refresh + + self.fake_srv = FakeSrv() + self.fake_srv_refresh = mock_zun_service_refresh + + @mock.patch.object(objects.ZunService, 'get_by_host_and_binary') + @mock.patch.object(objects.ZunService, 'create') + @mock.patch.object(objects.ZunService, 'report_state_up') + def test_update_zun_service_firsttime(self, + mock_srv_refresh, + mock_srv_create, + mock_srv_get + ): + p_task = periodic.ZunServicePeriodicTasks(CONF, + 'fake-conductor') + mock_srv_get.return_value = None + + p_task.update_zun_service(None) + + mock_srv_get.assert_called_once_with(mock.ANY, p_task.host, + p_task.binary) + mock_srv_create.assert_called_once_with() + mock_srv_refresh.assert_called_once_with() + + @mock.patch.object(objects.ZunService, 'get_by_host_and_binary') + @mock.patch.object(objects.ZunService, 'create') + def test_update_zun_service_on_restart(self, + mock_srv_create, + mock_srv_get): + p_task = periodic.ZunServicePeriodicTasks(CONF, + 'fake-conductor') + mock_srv_get.return_value = self.fake_srv + + p_task.update_zun_service(None) + + mock_srv_get.assert_called_once_with(mock.ANY, p_task.host, + p_task.binary) + self.fake_srv_refresh.assert_called_once_with() + + def test_update_zun_service_regular(self): + p_task = periodic.ZunServicePeriodicTasks(CONF, + 'fake-conductor') + p_task.zun_service_ref = self.fake_srv + + p_task.update_zun_service(None) + + self.fake_srv_refresh.assert_called_once_with() diff --git a/higgins/tests/unit/test_hacking.py b/zun/tests/unit/test_hacking.py similarity index 98% rename from higgins/tests/unit/test_hacking.py rename to zun/tests/unit/test_hacking.py index d6f829e45..13455b1b0 100644 --- a/higgins/tests/unit/test_hacking.py +++ b/zun/tests/unit/test_hacking.py @@ -17,14 +17,14 @@ import textwrap import mock import pep8 -from higgins.hacking import checks -from higgins.tests import base +from zun.hacking import checks +from zun.tests import base class HackingTestCase(base.BaseTestCase): """Hacking test class. - This class tests the hacking checks higgins .hacking.checks by passing + This class tests the hacking checks zun .hacking.checks by passing strings to the check methods like the pep8/flake8 parser would. The parser loops over each line in the file and then passes the parameters to the check method. The parameter names in the check method dictate what type of diff --git a/higgins/tests/unit/test_higgins.py b/zun/tests/unit/test_zun.py similarity index 85% rename from higgins/tests/unit/test_higgins.py rename to zun/tests/unit/test_zun.py index 9519c3f51..7189dae1e 100644 --- a/higgins/tests/unit/test_higgins.py +++ b/zun/tests/unit/test_zun.py @@ -13,16 +13,16 @@ # under the License. """ -test_higgins +test_zun ---------------------------------- -Tests for `higgins` module. +Tests for `zun` module. """ -from higgins.tests import base +from zun.tests import base -class TestHiggins(base.BaseTestCase): +class TestZun(base.BaseTestCase): def test_something(self): pass diff --git a/higgins/version.py b/zun/version.py similarity index 92% rename from higgins/version.py rename to zun/version.py index 46581f9f5..86fa50a21 100644 --- a/higgins/version.py +++ b/zun/version.py @@ -13,5 +13,5 @@ from pbr import version as pbr_version -version_info = pbr_version.VersionInfo('higgins') +version_info = pbr_version.VersionInfo('zun') version_string = version_info.version_string