revive working with subset of services

Change-Id: I645c5df457a2ac2c997ac32720d53cacc0fa109b
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..9d8366b
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,18 @@
+Andy Smith <github@anarkystic.com>
+Anthony Young <sleepsonthefloor@gmail.com>
+Brad Hall <brad@nicira.com>
+Chmouel Boudjnah <chmouel@chmouel.com>
+Dean Troyer <dtroyer@gmail.com>
+Devin Carlen <devin.carlen@gmail.com>
+Eddie Hebert <edhebert@gmail.com>
+Jake Dahn <admin@jakedahn.com>
+James E. Blair <james.blair@rackspace.com>
+Jason Cannavale <jason.cannavale@rackspace.com>
+Jay Pipes <jaypipes@gmail.com>
+Jesse Andrews <anotherjesse@gmail.com>
+Justin Shepherd <galstrom21@gmail.com>
+Scott Moser <smoser@ubuntu.com>
+Todd Willey <xtoddx@gmail.com>
+Tres Henry <tres@treshenry.net>
+Vishvananda Ishaya <vishvananda@gmail.com>
+Yun Mao <yunmao@gmail.com>
diff --git a/README.md b/README.md
index daf398b..8b2b038 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
 
 # Goals
 
-* To quickly build dev openstack environments in clean natty environments
+* To quickly build dev openstack environments in clean oneiric environments
 * To describe working configurations of openstack (which code branches work together?  what do config files look like for those branches?)
 * To make it easier for developers to dive into openstack so that they can productively contribute without having to understand every part of the system at once
 * To make it easy to prototype cross-project features
@@ -20,12 +20,6 @@
 * Horizon: http://myhost/
 * Keystone: http://myhost:5000/v2.0/
 
-# To start a dev cloud in an lxc container:
-
-    ./build_lxc.sh
-
-You will need to configure a bridge and network on your host machine (by default br0) before starting build_lxc.sh.  A sample host-only network configuration can be found in lxc_network_hostonlyplusnat.sh.
-
 # Customizing
 
 You can tweak environment variables by creating file name 'localrc' should you need to override defaults.  It is likely that you will need to do this to tweak your networking configuration should you need to access your cloud from a different host.
diff --git a/exercises/floating_ips.sh b/exercises/floating_ips.sh
index ae96e6a..dca6d5b 100755
--- a/exercises/floating_ips.sh
+++ b/exercises/floating_ips.sh
@@ -31,7 +31,7 @@
 # returns a token and catalog of endpoints.  We use python to parse the token
 # and save it.
 
-TOKEN=`curl -s -d  "{\"auth\":{\"passwordCredentials\": {\"username\": \"$NOVA_USERNAME\", \"password\": \"$NOVA_API_KEY\"}}}" -H "Content-type: application/json" http://$HOST_IP:5000/v2.0/tokens | python -c "import sys; import json; tok = json.loads(sys.stdin.read()); print tok['access']['token']['id'];"`
+TOKEN=`curl -s -d  "{\"auth\":{\"passwordCredentials\": {\"username\": \"$NOVA_USERNAME\", \"password\": \"$NOVA_PASSWORD\"}}}" -H "Content-type: application/json" http://$HOST_IP:5000/v2.0/tokens | python -c "import sys; import json; tok = json.loads(sys.stdin.read()); print tok['access']['token']['id'];"`
 
 # Launching a server
 # ==================
diff --git a/files/apts/horizon b/files/apts/horizon
index 22b3b30..6f145e1 100644
--- a/files/apts/horizon
+++ b/files/apts/horizon
@@ -1,5 +1,15 @@
-apache2
-libapache2-mod-wsgi
+apache2  # NOPRIME
+libapache2-mod-wsgi  # NOPRIME
 python-dateutil
+python-paste
+python-pastedeploy
 python-anyjson
 python-routes
+python-xattr
+python-sqlalchemy
+python-webob
+python-kombu
+pylint
+pep8
+python-eventlet
+python-nose
diff --git a/files/apts/nova b/files/apts/nova
index 32b7b37..f4fe459 100644
--- a/files/apts/nova
+++ b/files/apts/nova
@@ -5,6 +5,8 @@
 arping # used for send_arp_for_ha option in nova-network
 mysql-server # NOPRIME
 python-mysqldb
+python-xattr # needed for glance which is needed for nova --- this shouldn't be here
+python-lxml # needed for glance which is needed for nova --- this shouldn't be here
 kvm
 gawk
 iptables
@@ -36,8 +38,9 @@
 python-lockfile
 python-m2crypto
 python-boto
+python-kombu
 
 # Stuff for diablo volumes
-iscsitarget
-iscsitarget-dkms
+iscsitarget  # NOPRIME
+iscsitarget-dkms  # NOPRIME
 lvm2
diff --git a/files/pips/horizon b/files/pips/horizon
index bebc0be..672fbee 100644
--- a/files/pips/horizon
+++ b/files/pips/horizon
@@ -1,20 +1,9 @@
-nose==1.0.0
 Django==1.3
 django-nose==0.1.2
 django-mailer
 django-registration==0.7
-kombu
 python-cloudfiles
-python-dateutil
-webob
-sqlalchemy
-paste
-PasteDeploy
 sqlalchemy-migrate
-eventlet
-xattr
-pep8
-pylint
 
 -e git+https://github.com/jacobian/openstack.compute.git#egg=openstack
 
diff --git a/files/screenrc b/files/screenrc
index 1ca47da..e18db39 100644
--- a/files/screenrc
+++ b/files/screenrc
@@ -2,7 +2,7 @@
 hardstatus alwayslastline
 hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G}%H %{..Y}%d/%m %c"
 
-defscrollback 1024
+defscrollback 10240
 
 vbell off
 startup_message off
diff --git a/openrc b/openrc
index 4b36112..7c1e129 100644
--- a/openrc
+++ b/openrc
@@ -18,7 +18,8 @@
 export NOVA_USERNAME=${USERNAME:-demo}
 
 # With Keystone you pass the keystone password instead of an api key.
-export NOVA_API_KEY=${ADMIN_PASSWORD:-secrete}
+# The most recent versions of novaclient use NOVA_PASSWORD instead of NOVA_API_KEY
+export NOVA_PASSWORD=${ADMIN_PASSWORD:-secrete}
 
 # With the addition of Keystone, to use an openstack cloud you should
 # authenticate against keystone, which returns a **Token** and **Service
diff --git a/stack.sh b/stack.sh
index 96ad389..cdba542 100755
--- a/stack.sh
+++ b/stack.sh
@@ -10,22 +10,22 @@
 # shared settings for common resources (mysql, rabbitmq) and build a multi-node
 # developer install.
 
-# To keep this script simple we assume you are running on an **Ubuntu 11.04
-# Natty** machine.  It should work in a VM or physical server.  Additionally we
-# put the list of *apt* and *pip* dependencies and other configuration files in
-# this repo.  So start by grabbing this script and the dependencies.
+# To keep this script simple we assume you are running on an **Ubuntu 11.10
+# Oneiric** machine.  It should work in a VM or physical server.  Additionally
+# we put the list of *apt* and *pip* dependencies and other configuration files
+# in this repo.  So start by grabbing this script and the dependencies.
 
 # Learn more and get the most recent version at http://devstack.org
 
 # Sanity Check
 # ============
 
-# Warn users who aren't on natty, but allow them to override check and attempt
+# Warn users who aren't on oneiric, but allow them to override check and attempt
 # installation with ``FORCE=yes ./stack``
 DISTRO=$(lsb_release -c -s)
 
-if [[ ! ${DISTRO} =~ (natty|oneiric) ]]; then
-    echo "WARNING: this script has only been tested on natty and oneiric"
+if [[ ! ${DISTRO} =~ (oneiric) ]]; then
+    echo "WARNING: this script has only been tested on oneiric"
     if [[ "$FORCE" != "yes" ]]; then
         echo "If you wish to run this script anyway run with FORCE=yes"
         exit 1
@@ -66,10 +66,10 @@
 # We try to have sensible defaults, so you should be able to run ``./stack.sh``
 # in most cases.
 #
-# We our settings from ``stackrc``.  This file is distributed with devstack and
-# contains locations for what repositories to use.  If you want to use other
-# repositories and branches, you can add your own settings with another file
-# called ``localrc``
+# We source our settings from ``stackrc``.  This file is distributed with devstack
+# and contains locations for what repositories to use.  If you want to use other
+# repositories and branches, you can add your own settings with another file called
+# ``localrc``
 #
 # If ``localrc`` exists, then ``stackrc`` will load those settings.  This is
 # useful for changing a branch or repository to test other versions.  Also you
@@ -113,7 +113,7 @@
     fi
 
     echo "Giving stack user passwordless sudo priviledges"
-    # natty uec images sudoers does not have a '#includedir'. add one.
+    # some uec images sudoers does not have a '#includedir'. add one.
     grep -q "^#includedir.*/etc/sudoers.d" /etc/sudoers ||
         echo "#includedir /etc/sudoers.d" >> /etc/sudoers
     ( umask 226 && echo "stack ALL=(ALL) NOPASSWD:ALL" \
@@ -384,7 +384,7 @@
 function get_packages() {
     local file_to_parse="general"
     local service
-    
+
     for service in ${ENABLED_SERVICES//,/ }; do
         if [[ $service == n-* ]]; then
             if [[ ! $file_to_parse =~ nova ]]; then
@@ -473,20 +473,26 @@
 git_clone $NOVA_REPO $NOVA_DIR $NOVA_BRANCH
 # python client library to nova that horizon (and others) use
 git_clone $NOVACLIENT_REPO $NOVACLIENT_DIR $NOVACLIENT_BRANCH
+
+# glance, swift middleware and nova api needs keystone middleware
+if [[ "$ENABLED_SERVICES" =~ "key" || 
+      "$ENABLED_SERVICES" =~ "g-api" || 
+      "$ENABLED_SERVICES" =~ "n-api" || 
+      "$ENABLED_SERVICES" =~ "swift" ]]; then
+    # unified auth system (manages accounts/tokens)
+    git_clone $KEYSTONE_REPO $KEYSTONE_DIR $KEYSTONE_BRANCH
+fi
 if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then
     # storage service
     git_clone $SWIFT_REPO $SWIFT_DIR $SWIFT_BRANCH
     # swift + keystone middleware
     git_clone $SWIFT_KEYSTONE_REPO $SWIFT_KEYSTONE_DIR $SWIFT_KEYSTONE_BRANCH
 fi
-if [[ "$ENABLED_SERVICES" =~ "g-api" ]]; then
+if [[ "$ENABLED_SERVICES" =~ "g-api" ||
+      "$ENABLED_SERVICES" =~ "n-api" ]]; then
     # image catalog service
     git_clone $GLANCE_REPO $GLANCE_DIR $GLANCE_BRANCH
 fi
-if [[ "$ENABLED_SERVICES" =~ "key" ]]; then
-    # unified auth system (manages accounts/tokens)
-    git_clone $KEYSTONE_REPO $KEYSTONE_DIR $KEYSTONE_BRANCH
-fi
 if [[ "$ENABLED_SERVICES" =~ "n-vnc" ]]; then
     # a websockets/html5 or flash powered VNC console for vm instances
     git_clone $NOVNC_REPO $NOVNC_DIR $NOVNC_BRANCH
@@ -511,14 +517,18 @@
 
 # setup our checkouts so they are installed into python path
 # allowing ``import nova`` or ``import glance.client``
-if [[ "$ENABLED_SERVICES" =~ "key" ]]; then
+if [[ "$ENABLED_SERVICES" =~ "key" || 
+      "$ENABLED_SERVICES" =~ "g-api" || 
+      "$ENABLED_SERVICES" =~ "n-api" || 
+      "$ENABLED_SERVICES" =~ "swift" ]]; then
     cd $KEYSTONE_DIR; sudo python setup.py develop
 fi
 if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then
     cd $SWIFT_DIR; sudo python setup.py develop
     cd $SWIFT_KEYSTONE_DIR; sudo python setup.py develop
 fi
-if [[ "$ENABLED_SERVICES" =~ "g-api" ]]; then
+if [[ "$ENABLED_SERVICES" =~ "g-api" ||
+      "$ENABLED_SERVICES" =~ "n-api" ]]; then
     cd $GLANCE_DIR; sudo python setup.py develop
 fi
 cd $NOVACLIENT_DIR; sudo python setup.py develop
@@ -596,6 +606,9 @@
 
 if [[ "$ENABLED_SERVICES" =~ "horizon" ]]; then
 
+    # Install apache2, which is NOPRIME'd
+    apt_get install apache2 libapache2-mod-wsgi
+
     # Horizon currently imports quantum even if you aren't using it.  Instead
     # of installing quantum we can create a simple module that will pass the
     # initial imports
@@ -720,7 +733,7 @@
     # virtual machines.  If there is a partition labeled nova-instances we
     # mount it (ext filesystems can be labeled via e2label).
     if [ -L /dev/disk/by-label/nova-instances ]; then
-        if ! mount -n | grep -q nova-instances; then
+        if ! mount -n | grep -q $NOVA_DIR/instances; then
             sudo mount -L nova-instances $NOVA_DIR/instances
             sudo chown -R `whoami` $NOVA_DIR/instances
         fi
@@ -876,7 +889,9 @@
     # invoking stack.sh.
     #
     # By default, the backing file is 2G in size, and is stored in /opt/stack.
-    #
+
+    apt_get install iscsitarget-dkms iscsitarget
+
     if ! sudo vgdisplay | grep -q $VOLUME_GROUP; then
         VOLUME_BACKING_FILE=${VOLUME_BACKING_FILE:-$DEST/nova-volumes-backing-file}
         VOLUME_BACKING_FILE_SIZE=${VOLUME_BACKING_FILE_SIZE:-2052M}
@@ -897,7 +912,6 @@
 # (re)create nova.conf
 rm -f $NOVA_DIR/bin/nova.conf
 add_nova_flag "--verbose"
-add_nova_flag "--nodaemon"
 add_nova_flag "--allow_admin_api"
 add_nova_flag "--scheduler_driver=$SCHEDULER"
 add_nova_flag "--dhcpbridge_flagfile=$NOVA_DIR/bin/nova.conf"
@@ -944,6 +958,12 @@
     add_nova_flag "--use_syslog"
 fi
 
+# You can define extra nova conf flags by defining the array EXTRA_FLAGS,
+# For Example: EXTRA_FLAGS=(--foo --bar=2)
+for I in "${EXTRA_FLAGS[@]}"; do
+    add_nova_flag $i
+done
+
 # XenServer
 # ---------
 
diff --git a/stackrc b/stackrc
index 854a44c..6a56a2a 100644
--- a/stackrc
+++ b/stackrc
@@ -27,7 +27,7 @@
 HORIZON_BRANCH=stable/diablo
 
 # python client library to nova that horizon (and others) use
-NOVACLIENT_REPO=https://github.com/rackspace/python-novaclient.git
+NOVACLIENT_REPO=https://github.com/openstack/python-novaclient.git
 NOVACLIENT_BRANCH=master
 
 # openstackx is a collection of extensions to openstack.compute & nova