From 923f1b226378014657b028f6e4785cd18b3f1b45 Mon Sep 17 00:00:00 2001
From: Dolph Mathews <dolph.mathews@gmail.com>
Date: Mon, 23 Mar 2015 21:05:33 +0000
Subject: [PATCH] Remove support for ~/.openstack_deploy/

The README documents support for housing openstack_deploy/ in an
unprivildged user's home directory, but then the script for creating
openstack-ansible immediately requires root privileges, meaning that you
can't setup openstack_deploy/ in an unpriviledged user's home dir at
all.

This removes support for the feature instead of trying to fix it,
because I don't see a use case in keeping it, and there are many
additional fixed references to /etc/keystone_deploy/ that would have to
be made dynamic.

Change-Id: I19c6a568d1d52c33b3c13e9c007ca59e44d8c1dd
Closes-Bug: 1435597
---
 README.rst                               | 4 ++--
 playbooks/inventory/dynamic_inventory.py | 2 --
 scripts/inventory-manage.py              | 4 ----
 3 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/README.rst b/README.rst
index 2f30f080ef..471b3ab2ec 100644
--- a/README.rst
+++ b/README.rst
@@ -27,8 +27,8 @@ Basic Setup:
       version: master
 
   2. Run the ``./scripts/bootstrap-ansible.sh`` script, which will install, pip, ansible 1.8.x, all of the required python packages, and bring in any third part ansible roles that you may want to add to the deployment.
-  3. Copy the ``etc/openstack_deploy`` directory to ``/etc/openstack_deploy`` or if you are executing all of this as an unprivileged user you can add the ``openstack_deploy`` bits into your home directory as ``${HOME}/.openstack_deploy``.
-  4. Fill in your ``openstack_deploy/openstack_user_config.yml``, ``openstack_deploy/user_secrets.yml`` and ``openstack_deploy/user_variables.yml`` files which you've just copied to your ``/etc/`` directory or your ``${HOME}`` folder.
+  3. Copy the ``etc/openstack_deploy`` directory to ``/etc/openstack_deploy``.
+  4. Fill in your ``openstack_deploy/openstack_user_config.yml``, ``openstack_deploy/user_secrets.yml`` and ``openstack_deploy/user_variables.yml`` files which you've just copied to your ``/etc/`` directory.
   5. Generate all of your random passwords executing ``scripts/pw-token-gen.py --file /etc/openstack_deploy/user_secrets.yml``.
   6. Accomplish all of the host networking that you want to use within the deployment. See the ``etc/network`` directory in this repository for an example network setup.
   7. When ready change to the ``playbooks/`` directory and execute your desired plays.  IE: 
diff --git a/playbooks/inventory/dynamic_inventory.py b/playbooks/inventory/dynamic_inventory.py
index 7eaee07069..4ccd612d34 100755
--- a/playbooks/inventory/dynamic_inventory.py
+++ b/playbooks/inventory/dynamic_inventory.py
@@ -697,7 +697,6 @@ def file_find(pass_exception=False, user_file=None):
     If no file is found the system will exit.
     The file lookup will be done in the following directories:
       /etc/openstack_deploy/
-      $HOME/openstack_deploy/
       $(pwd)/openstack_deploy/
 
     :param pass_exception: ``bol``
@@ -705,7 +704,6 @@ def file_find(pass_exception=False, user_file=None):
     """
     file_check = [
         os.path.join('/etc', 'openstack_deploy'),
-        os.path.join(os.environ.get('HOME'), 'openstack_deploy')
     ]
 
     if user_file is not None:
diff --git a/scripts/inventory-manage.py b/scripts/inventory-manage.py
index 91201f305a..3304bc62e4 100755
--- a/scripts/inventory-manage.py
+++ b/scripts/inventory-manage.py
@@ -27,7 +27,6 @@ def file_find(filename, user_file=None, pass_exception=False):
     If no file is found the system will exit.
     The file lookup will be done in the following directories:
       /etc/openstack_deploy/
-      $HOME/openstack_deploy/
       $(pwd)/openstack_deploy/
 
     :param filename: ``str``  Name of the file to find
@@ -37,9 +36,6 @@ def file_find(filename, user_file=None, pass_exception=False):
         os.path.join(
             '/etc', 'openstack_deploy', filename
         ),
-        os.path.join(
-            os.environ.get('HOME'), 'openstack_deploy', filename
-        ),
         os.path.join(
             os.getcwd(), filename
         )