Skip to content

Commit

Permalink
fix: add playbooks in the python package
Browse files Browse the repository at this point in the history
  • Loading branch information
gavindsouza committed May 1, 2020
1 parent e791410 commit 78e1f03
Show file tree
Hide file tree
Showing 87 changed files with 10 additions and 6 deletions.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion playbooks/install.py → bench/playbooks/install.py
Expand Up @@ -359,7 +359,7 @@ def run_playbook(playbook_name, sudo=False, extra_vars=None):
else:
cwd = os.path.join(os.path.expanduser('~'), 'bench')

success = subprocess.check_call(args, cwd=os.path.join(cwd, 'playbooks'), stdout=log_stream, stderr=sys.stderr)
success = subprocess.check_call(args, cwd=os.path.join(cwd, 'bench', 'playbooks'), stdout=log_stream, stderr=sys.stderr)
return success


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion bench/utils.py
Expand Up @@ -961,7 +961,7 @@ def run_playbook(playbook_name, extra_vars=None, tag=None):
if tag:
args.extend(['-t', tag])

subprocess.check_call(args, cwd=os.path.join(os.path.dirname(bench.__path__[0]), 'playbooks'))
subprocess.check_call(args, cwd=os.path.join(bench.__path__[0], 'playbooks'))


def find_benches(directory=None):
Expand Down
12 changes: 8 additions & 4 deletions setup.py
@@ -1,13 +1,16 @@
from setuptools import setup, find_packages
import re, ast
import ast
import os
import re

# get version from __version__ variable in bench/__init__.py
_version_re = re.compile(r'__version__\s+=\s+(.*)')
from setuptools import find_packages, setup

playbooks_files = [os.path.join(dp, f) for dp, dn, filenames in os.walk("playbooks") for f in filenames]

with open('requirements.txt') as f:
install_requires = f.read().strip().split('\n')

with open('bench/__init__.py', 'rb') as f:
_version_re = re.compile(r'__version__\s+=\s+(.*)')
version = str(ast.literal_eval(_version_re.search(
f.read().decode('utf-8')).group(1)))

Expand All @@ -21,6 +24,7 @@
zip_safe=False,
include_package_data=True,
install_requires=install_requires,
package_data={ 'bench': playbooks_files },
entry_points='''
[console_scripts]
bench=bench.cli:cli
Expand Down

0 comments on commit 78e1f03

Please sign in to comment.