From e0ccae357ff3e8e425ec9f3dc14326f74a6ca402 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Fri, 31 May 2013 16:39:50 -0700 Subject: [PATCH] Move multipip and associated to tools + docs. Use the readme.rst for multipip for other tools and place multipip and the new tools under tools since they are anvil tools and should be under that directory. Adjust the code to look under that directory when finding py2rpm and multipip. Remove some tools which are no longer needed/used/make sense. Change-Id: If3a0d627c42ef0374f764ad9e276424b43f29a66 --- anvil/packaging/base.py | 2 +- anvil/packaging/yum.py | 2 +- smithy | 2 +- {multipip => tools}/README.rst | 60 +++++++++++++++--- clean-pip => tools/clean-pip | 0 tools/clear-net-ubuntu.sh | 46 -------------- tools/component-config.py | 26 -------- {multipip => tools}/multipip | 0 tools/pip-scan.py | 109 --------------------------------- {multipip => tools}/py2rpm | 0 10 files changed, 55 insertions(+), 192 deletions(-) rename {multipip => tools}/README.rst (67%) rename clean-pip => tools/clean-pip (100%) delete mode 100755 tools/clear-net-ubuntu.sh delete mode 100755 tools/component-config.py rename {multipip => tools}/multipip (100%) delete mode 100755 tools/pip-scan.py rename {multipip => tools}/py2rpm (100%) diff --git a/anvil/packaging/base.py b/anvil/packaging/base.py index 7aa6778e..4a2c6a3f 100644 --- a/anvil/packaging/base.py +++ b/anvil/packaging/base.py @@ -91,7 +91,7 @@ OPENSTACK_PACKAGES = set([ class DependencyHandler(object): """Basic class for handler of OpenStack dependencies. """ - multipip_executable = sh.which("multipip", ["multipip"]) + multipip_executable = sh.which("multipip", ["tools/"]) # Update requirements to make them allow already installed packages force_frozen = True diff --git a/anvil/packaging/yum.py b/anvil/packaging/yum.py index ab781252..3a278485 100644 --- a/anvil/packaging/yum.py +++ b/anvil/packaging/yum.py @@ -108,7 +108,7 @@ class YumPackager(base.Packager): class YumDependencyHandler(base.DependencyHandler): OPENSTACK_DEPS_PACKAGE_NAME = "openstack-deps" OPENSTACK_EPOCH = 2 - py2rpm_executable = sh.which("py2rpm", ["multipip"]) + py2rpm_executable = sh.which("py2rpm", ["tools/"]) def __init__(self, distro, root_dir, instances): super(YumDependencyHandler, self).__init__(distro, root_dir, instances) diff --git a/smithy b/smithy index 254d234f..e20547f2 100755 --- a/smithy +++ b/smithy @@ -7,7 +7,7 @@ cd "$(dirname "$0")" YUM_OPTS="--assumeyes --nogpgcheck" PIP_CMD="" -PY2RPM_CMD="$PWD/multipip/py2rpm" +PY2RPM_CMD="$PWD/tools/py2rpm" # Source in our variables (or overrides) source ".anvilrc" diff --git a/multipip/README.rst b/tools/README.rst similarity index 67% rename from multipip/README.rst rename to tools/README.rst index 5979cfb8..d1a7106c 100644 --- a/multipip/README.rst +++ b/tools/README.rst @@ -1,5 +1,8 @@ +**Anvil utility toolbelt** +========================== + multipip -======== +-------- `pip` utility refuses to handle multiple requirements for one package:: @@ -54,22 +57,23 @@ freeze`):: pip==1.2 py2rpm -====== +------ Distutils provides an interface for building RPMs:: $ python ./setup.py bdist_rpm This tool has several problems: + * Red Hat based distros use different package names, e.g., `python-setuptools` instead of `distribute`, `python-nose` instead - of `nose` and so on; -* `Requires` and `Conflicts` sections for generated RPM are incorrect; -* sometimes not all required files are packaged; -* miscellaneous problems with man files; -* package directory in `/usr/lib*/python*/site-packages/` is not + of `nose` and so on... +* `Requires` and `Conflicts` sections for generated RPM are incorrect. +* Sometimes not all required files are packaged. +* Miscellaneous problems with man files; +* Package directory in `/usr/lib*/python*/site-packages/` is not owned by any RPM; -* some packages (like selenium) are architecture dependent but +* Some packages (like selenium) are architecture dependent but `bdist_rpm` generates `BuildArch: noarch` for them. `py2rpm` is aimed to solve all these problems. @@ -82,3 +86,43 @@ builds RPMs (current directory is used by default):: Wrote: /home/guest/rpmbuild/SRPMS/python-multipip-0.1-1.src.rpm Wrote: /home/guest/rpmbuild/RPMS/noarch/python-multipip-0.1-1.noarch.rpm ... + +build-install-node-from-source.sh +--------------------------------- + +Helps build latest `node.js` from source into rpms. + +clean-pip +--------- + +This utility removes package installed by pip but not by rpm. + +clear-dns.sh +------------ + +Removes leftover nova dnsmasq processes frequently left behind. + +img-uploader +------------ + +Helper tool to upload images to glance using your anvil settings. + +validate-yaml +------------- + +Validates yaml is formatted correctly. + +yaml-pretty +----------- + +Pretty prints yaml into a standard format. + +resize.sh +--------- + +Resizes a images filesystem using guestfish. + +euca.sh +------- + +Creates ec2 keys for usage with nova. diff --git a/clean-pip b/tools/clean-pip similarity index 100% rename from clean-pip rename to tools/clean-pip diff --git a/tools/clear-net-ubuntu.sh b/tools/clear-net-ubuntu.sh deleted file mode 100755 index b08461d4..00000000 --- a/tools/clear-net-ubuntu.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -x - -ETH_SRC="eth0" - -echo "Clearing your network up." - -if [[ -n `brctl show | grep -i br100` ]] -then - echo "Clearing br100 and making $ETH_SRC be the real interface." - sudo ifconfig $ETH_SRC down - sudo ifconfig br100 down - sudo brctl delif br100 $ETH_SRC - sudo brctl delbr br100 -fi - -if [[ -n `brctl show | grep -i virbr0` ]] -then - echo "Removing virbr0" - sudo ifconfig virbr0 down - sudo brctl delbr virbr0 -fi - - -for pid in `ps -elf | grep -i dnsmasq | grep nova | perl -le 'while (<>) { my $pid = (split /\s+/)[3]; print $pid; }'` -do - echo "Killing leftover nova dnsmasq process with process id $pid" - kill -9 $pid -done - - -if [[ -z `grep "iface $ETH_SRC" /etc/network/interfaces` ]] -then - - echo "Readjusting /etc/network/interfaces to have DHCP on for $ETH_SRC" - sudo cat > /etc/network/interfaces <