8000 Add configuration option for appending to sys.path by troyready · Pull Request #179 · cloudtools/stacker · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add configuration option for appending to sys.path #179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 2, 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
9 changes: 9 additions & 0 deletions docs/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ updating your stacks. By default it uses a bucket named
If you want to change this, provide the **stacker_bucket** top level key word
in the config.

Module Paths
----------------
When setting the ``classpath`` for blueprints/hooks, it is sometimes desirable to
load modules from outside the default ``sys.path`` (e.g., to include modules
inside the same repo as config files).

Adding a path (e.g. ``./``) to the **sys_path** top level key word will allow
modules from that path location to be used.

Pre & Post Hooks
----------------

Expand Down
3 changes: 3 additions & 0 deletions stacker/actions/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import copy
import logging
import sys

import boto3
import botocore.exceptions
Expand Down Expand Up @@ -118,6 +119,8 @@ def s3_stack_push(self, blueprint, force=False):
return template_url

def execute(self, *args, **kwargs):
if "sys_path" in self.context.config:
sys.path.append(self.context.config["sys_path"])
self.pre_run(*args, **kwargs)
self.run(*args, **kwargs)
self.post_run(*args, **kwargs)
Expand Down
0