Skip to content
This repository has been archived by the owner. It is now read-only.

Fix for hubblestack_nova spm build #249

Merged
merged 1 commit into from
Sep 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ iterate policy changes separate from the code.

.. code-block:: shell

wget http://spm.hubblestack.io/nova/hubblestack_nova_modules-2016.9.1-1.spm
spm local install hubblestack_nova_modules-2016.9.1-1.spm
wget http://spm.hubblestack.io/nova/hubblestack_nova-2016.9.2.spm
spm local install hubblestack_nova-2016.9.2.spm

**Nova Profiles**

Expand Down Expand Up @@ -92,7 +92,7 @@ it to the minions.
mkdir -p /srv/salt/_modules/
cp _modules/hubble.py /srv/salt/_modules/
cp -a hubblestack_nova_profiles /srv/salt/
cp -a hubblestack_nova_modules /srv/salt/
cp -a hubblestack_nova /srv/salt/

salt \* saltutil.sync_modules
salt \* hubble.sync
Expand Down Expand Up @@ -127,7 +127,7 @@ Usage

There are four primary functions in the hubble.py module:

1. ``hubble.sync`` will sync the ``hubblestack_nova_profiles/`` and ``hubblestack_nova_modules/`` directories to the minion(s).
1. ``hubble.sync`` will sync the ``hubblestack_nova_profiles/`` and ``hubblestack_nova/`` directories to the minion(s).
2. ``hubble.load`` will load the synced audit modules and their yaml configuration files.
3. ``hubble.audit`` will audit the minion(s) using the YAML profile(s) you provide as comma-separated arguments
4. ``hubble.top`` will audit the minion(s) using the ``top.nova`` configuration.
Expand Down Expand Up @@ -276,7 +276,7 @@ configurable via pillar. The defaults are shown below:
hubblestack:
nova:
saltenv: base
module_dir: salt://hubblestack_nova_modules
module_dir: salt://hubblestack_nova
profile_dir: salt://hubblestack_nova_profiles

2. By default, ``hubble.audit`` will call ``hubble.load`` (which in turn calls
Expand Down
8 changes: 5 additions & 3 deletions _modules/hubble.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ def sync(clean=False):
Sync the nova audit modules and profiles from the saltstack fileserver.

The modules should be stored in the salt fileserver. By default nova will
search the base environment for a top level ``hubblestack_nova_modules``
search the base environment for a top level ``hubblestack_nova``
directory, unless otherwise specified via pillar or minion config
(``hubblestack:nova:module_dir``)

Expand Down Expand Up @@ -448,7 +448,7 @@ def sync(clean=False):
nova_profile_dir = __salt__['config.get']('hubblestack:nova:profile_dir',
'salt://hubblestack_nova_profiles')
nova_module_dir = __salt__['config.get']('hubblestack:nova:module_dir',
'salt://hubblestack_nova_modules')
'salt://hubblestack_nova')
saltenv = __salt__['config.get']('hubblestack:nova:saltenv', 'base')

# Clean previously synced files
Expand Down Expand Up @@ -519,7 +519,7 @@ def _hubble_dir():
nova_profile_dir = __salt__['config.get']('hubblestack:nova:profile_dir',
'salt://hubblestack_nova_profiles')
nova_module_dir = __salt__['config.get']('hubblestack:nova:module_dir',
'salt://hubblestack_nova_modules')
'salt://hubblestack_nova')
dirs = []
# Support optional salt:// in config
for nova_dir in (nova_module_dir, nova_profile_dir):
Expand Down Expand Up @@ -630,6 +630,8 @@ def refresh_file_mapping(self):
# in the profiles directory. This is hacky but was a
# quick fix.
nova_module_cache, nova_profile_cache = _hubble_dir()
nova_module_cache = os.path.join(nova_module_cache, '')
nova_profile_cache = os.path.join(nova_profile_cache, '')
if ext == '.py' and fpath.startswith(nova_profile_cache):
continue
if ext == '.yaml' and fpath.startswith(nova_module_cache):
Expand Down
File renamed without changes.