diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 6cb3b25..0000000 --- a/.gitignore +++ /dev/null @@ -1,16 +0,0 @@ -*~ -.testrepository -*.sw? -*.pyc -.tox -*.egg -*.egg-info -dist -*.qcow2 -*.raw -*.initrd -*.vmlinuz -build -AUTHORS -ChangeLog -bin/diskimage_builder diff --git a/.zuul.yaml b/.zuul.yaml deleted file mode 100644 index 314ea4a..0000000 --- a/.zuul.yaml +++ /dev/null @@ -1,12 +0,0 @@ -- project: - templates: - - check-requirements - check: - jobs: - - openstack-tox-functional - gate: - jobs: - - openstack-tox-functional - post: - jobs: - - publish-openstack-python-branch-tarball diff --git a/LICENSE b/LICENSE deleted file mode 100644 index d645695..0000000 --- a/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/README.md b/README.md deleted file mode 100644 index 74996cf..0000000 --- a/README.md +++ /dev/null @@ -1,16 +0,0 @@ -Team and repository tags -======================== - -[![Team and repository tags](http://governance.openstack.org/badges/dib-utils.svg)](http://governance.openstack.org/reference/tags/index.html) - - - -Standalone tools related to diskimage-builder -============================================= - -These tools were originally part of the diskimage-builder project, but they have -uses outside of that project as well. Because disk space is at a premium in -base cloud images, pulling in all of diskimage-builder and its dependencies just to -use something like dib-run-parts is not desirable. This project allows consumers -to use the tools while pulling in only one small package with few/no additional -dependencies. diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..4ee2c5f --- /dev/null +++ b/README.rst @@ -0,0 +1,10 @@ +This project is no longer maintained. + +The contents of this repository are still available in the Git +source code management system. To see the contents of this +repository before it reached its end of life, please check out the +previous commit with "git checkout HEAD^1". + +For any further questions, please email +openstack-discuss@lists.openstack.org or join #openstack-dev on +OFTC. diff --git a/bin/dib-run-parts b/bin/dib-run-parts deleted file mode 100755 index 0f81be1..0000000 --- a/bin/dib-run-parts +++ /dev/null @@ -1,144 +0,0 @@ -#!/bin/bash -# Inspired by Debian and RedHat run-parts but portable and specific to di-b. -# -# Copyright 2012 Hewlett-Packard Development Company, L.P. -# -# 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. - -allowed_regex=${RUN_PARTS_REGEX:-"^[0-9A-Za-z_-]+$"} -show_list= - -set -ue -set -o pipefail - -name=$(basename $0) - -usage() { - echo "Usage: $name [OPTION] scripts_directory" - echo "Option:" - echo " --list print names of all valid files" - echo - echo "Examples:" - echo " dib-run-parts --list /opt/stack/os-config-refresh/configure.d/" - echo " dib-run-parts /opt/stack/os-config-refresh/configure.d/" - exit 1 -} >&2 - - -output_prefix() { - printf "%s %s " "${name}" "$(date)" >&2 -} - -output () { - output_prefix - echo $* >&2 -} - -output_printf () { - local FORMAT="$1" - shift - output_prefix - printf "${FORMAT}" $@ >&2 -} - -# source the environment files from environment.d -# arg : target_dir -source_environment() { - - local dir=$target_dir/../environment.d - local env_files - local xtrace - - if [ -d ${dir} ] ; then - env_files=$(find ${dir} -maxdepth 1 -xtype f | \ - grep -E "/[0-9A-Za-z_\.-]+$" | \ - LANG=C sort -n) - for env_file in $env_files ; do - output "Sourcing environment file ${env_file}" - # Set tracing as we import these environment files; it's - # nice to see the definitions in the logs - xtrace=$(set +o | grep xtrace) - set -o xtrace - source $env_file - $xtrace - done - fi -} - -if [ $# -lt 1 ] ; then - usage -fi - -if [ "$1" == "--list" ] ; then - show_list="1" - shift -fi - -target_dir="${1:-}" - -if ! [ -d "$target_dir" ] ; then - output "Scripts directory [$target_dir] must exist and be a directory" - usage -fi - -# We specifically only want to sort *by the numbers*. -# Lexical sorting is not guaranteed, and identical numbers may be -# parallelized later -# Note: -maxdepth 1 ensures only files in the target directory (but not -# subdirectories) are run, which is the way run-parts behaves. -targets=$(find $target_dir -maxdepth 1 -xtype f -executable -printf '%f\n' | grep -E "$allowed_regex" | LANG=C sort -n || echo "") - -if [ "$show_list" == "1" ] ; then - for target in $targets ; do - echo "${target_dir}/${target}" - done - exit 0 -fi - -PROFILE_DIR=$(mktemp -d --tmpdir profiledir.XXXXXX) - -# note, run this in a sub-shell so we don't pollute our -# own environment with source_environment -( - source_environment - - for target in $targets ; do - output "Running $target_dir/$target" - target_tag=${target//\//_} - date +%s.%N > $PROFILE_DIR/start_$target_tag - $target_dir/$target - target_tag=${target//\//_} - date +%s.%N > $PROFILE_DIR/stop_$target_tag - output "$target completed" - done -) - -output "----------------------- PROFILING -----------------------" -output "" -output "Target: $(basename $target_dir)" -output "" -output_printf "%-40s %9s\n" Script Seconds -output_printf "%-40s %9s\n" --------------------------------------- ---------- -output "" -pushd $PROFILE_DIR > /dev/null -for target in $(find . -name 'start_*' -printf '%f\n' | env LC_ALL=C sort -n) ; do - stop_file=stop_${target##start_} - start_seconds=$(cat $target) - stop_seconds=$(cat $stop_file) - duration=$(echo - | awk "{ print $stop_seconds - $start_seconds }") - LC_NUMERIC=C LC_ALL=C output_printf "%-40s %10.3f\n" ${target##start_} $duration -done -popd > /dev/null -rm -rf $PROFILE_DIR -output "" -output "--------------------- END PROFILING ---------------------" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 4ae80f0..0000000 --- a/setup.cfg +++ /dev/null @@ -1,22 +0,0 @@ -[metadata] -name = dib-utils -summary = Pieces of diskimage-builder that are useful without the rest of the project -description-file = - README.md -author = HP Cloud Services -author_email = openstack-dev@lists.openstack.org -license: Apache License (2.0) -home-page = https://git.openstack.org/cgit/openstack/dib-utils -classifier = - Development Status :: 3 - Alpha - License :: OSI Approved :: Apache Software License - Operating System :: POSIX :: Linux - Programming Language :: Python :: 2.7 - Environment :: Console - -[files] -scripts = - bin/dib-run-parts - -[wheel] -universal = 1 diff --git a/setup.py b/setup.py deleted file mode 100755 index 70c2b3f..0000000 --- a/setup.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. -# -# 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. - -# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT -import setuptools - -setuptools.setup( - setup_requires=['pbr'], - pbr=True) diff --git a/tests/run_tests.sh b/tests/run_tests.sh deleted file mode 100755 index 24f9146..0000000 --- a/tests/run_tests.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# -# Runs all test cases in this directory -# - -set -ue -set -o pipefail - -TESTS_BASE_DIR=$(cd $(dirname "$0") && pwd) - -for tc in ${TESTS_BASE_DIR}/tc??.sh; do - echo "--- Running ${tc} ---" - ${tc} -done - -echo "--- TESTS COMPLETE ---" diff --git a/tests/tc01.sh b/tests/tc01.sh deleted file mode 100755 index 19948d4..0000000 --- a/tests/tc01.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -# -# Runs dib-run-parts on an empty directory. -# - -set -ue -set -o pipefail -set -x - -TESTS_BASE_DIR=$(cd $(dirname "$0") && pwd) - -DRP_BIN=${TESTS_BASE_DIR}/../bin/dib-run-parts - -TEST_EXEC_DIR=${TESTS_BASE_DIR}/tc01/td - -mkdir -p ${TEST_EXEC_DIR} -rval=0 - -RES=$(${DRP_BIN} --list ${TEST_EXEC_DIR}) -if test $? -ne 0; then - echo "*** FAILED: --list of empty dir failed" - rval=1 -fi -if test -n "${RES}"; then - echo "*** FAILED: --list of empty dir not empty" - rval=1 -fi - -RES=$(${DRP_BIN} ${TEST_EXEC_DIR} 2>/dev/null) -if test $? -ne 0; then - echo "*** FAILED: dib-run-parts on empty dir failed" - rval=1 -fi -if test -n "${RES}"; then - echo "*** FAILED: dib-run-parts on empty dir not empty" - rval=1 -fi - -exit ${rval} diff --git a/tests/tc02.sh b/tests/tc02.sh deleted file mode 100755 index f33f355..0000000 --- a/tests/tc02.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -# -# Runs dib-run-parts on directory containing some scripts. -# - -set -ue -set -o pipefail -set -x - -TESTS_BASE_DIR=$(cd $(dirname "$0") && pwd) - -DRP_BIN=${TESTS_BASE_DIR}/../bin/dib-run-parts - -TEST_EXEC_DIR=${TESTS_BASE_DIR}/tc02/td - -rval=0 - -RES=$(${DRP_BIN} --list ${TEST_EXEC_DIR}) -if test $? -ne 0; then - echo "*** FAILED: --list failed" - rval=1 -fi - -EXPECTED="${TESTS_BASE_DIR}/tc02/td/call_me_1 -${TESTS_BASE_DIR}/tc02/td/call_me_2" - -if test "${EXPECTED}" != "${RES}"; then - echo "*** FAILED: --list returns incorrect result" - rval=1 -fi - -RES=$(${DRP_BIN} ${TEST_EXEC_DIR} 2>/dev/null) -if test $? -ne 0; then - echo "*** FAILED: dib-run-parts on empty dir failed" - rval=1 -fi - -EXPECTED="call_me_1 called -call_me_2 called" - -if test "${EXPECTED}" != "${RES}"; then - echo "*** FAILED: dib-run-parts returns incorrect result" - rval=1 -fi - -exit ${rval} diff --git a/tests/tc02/td/call_me_1 b/tests/tc02/td/call_me_1 deleted file mode 100755 index 4e3b6a0..0000000 --- a/tests/tc02/td/call_me_1 +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -echo "call_me_1 called" diff --git a/tests/tc02/td/call_me_2 b/tests/tc02/td/call_me_2 deleted file mode 100755 index d96423d..0000000 --- a/tests/tc02/td/call_me_2 +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -echo "call_me_2 called" diff --git a/tests/tc03.sh b/tests/tc03.sh deleted file mode 100755 index 605f88c..0000000 --- a/tests/tc03.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# -# Runs dib-run-parts on directory containing some scripts -# and using the environment directory. -# - -set -ue -set -o pipefail -set -x - -TESTS_BASE_DIR=$(dirname $0) - -DRP_BIN=${TESTS_BASE_DIR}/../bin/dib-run-parts - -TEST_EXEC_DIR=${TESTS_BASE_DIR}/tc03/td - -rval=0 - -RES=$(${DRP_BIN} ${TEST_EXEC_DIR} 2>/dev/null) -if test $? -ne 0; then - echo "*** FAILED: dib-run-parts failed" - rval=1 -fi - -EXPECTED="call_me_1 called [Some thing] -call_me_2 called [Other thing]" - -if test "${EXPECTED}" != "${RES}"; then - echo "*** FAILED: dib-run-parts returns incorrect result" - rval=1 -fi - -exit ${rval} diff --git a/tests/tc03/environment.d/set_var.bash b/tests/tc03/environment.d/set_var.bash deleted file mode 100644 index d9dc4ac..0000000 --- a/tests/tc03/environment.d/set_var.bash +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -export CM1="Some thing" -export CM2="Other thing" - diff --git a/tests/tc03/td/call_me_1 b/tests/tc03/td/call_me_1 deleted file mode 100755 index 11a4850..0000000 --- a/tests/tc03/td/call_me_1 +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -echo "call_me_1 called [${CM1}]" diff --git a/tests/tc03/td/call_me_2 b/tests/tc03/td/call_me_2 deleted file mode 100755 index db5dec8..0000000 --- a/tests/tc03/td/call_me_2 +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -echo "call_me_2 called [${CM2}]" diff --git a/tox.ini b/tox.ini deleted file mode 100644 index ed0aa46..0000000 --- a/tox.ini +++ /dev/null @@ -1,19 +0,0 @@ -[tox] -minversion = 1.6 -skipsdist = True - -[testenv:venv] -basepython = python3 -commands = {posargs} - -[testenv:func] -# Replaced in CI with "functional" environment but kept here as a -# backwards-compatibility shim for transition -changedir={toxinidir}/tests -envdir = {toxworkdir}/venv -commands = {[testenv:functional]commands} - -[testenv:functional] -changedir={toxinidir}/tests -envdir = {toxworkdir}/venv -commands = ./run_tests.sh {posargs}