Skip to content
This repository has been archived by the owner on Mar 23, 2019. It is now read-only.

Fixes missing build files when using --project-path #655

Merged
merged 1 commit into from
Jul 20, 2017
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
11 changes: 9 additions & 2 deletions container/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
from .exceptions import AnsibleContainerConfigException, AnsibleContainerNotInitializedException
from .utils import get_metadata_from_role, get_defaults_from_role

# TODO: Actually do some schema validation

# jag: Division of labor between outer utility and conductor:
#
# Out here, we will parse the container.yml and process AC_* environment
Expand Down Expand Up @@ -227,10 +225,19 @@ def _get_variables_from_file(self, var_file):

SUPPORTED_COMPOSE_VERSIONS = ['1', '2']

REQUIRED_TOP_LEVEL_KEYS = ['services']

# TODO: Add more schema validation

def _validate_config(self, config):
for key in self.REQUIRED_TOP_LEVEL_KEYS:
if not config.get(key):
raise AnsibleContainerConfigException("Missing expected key '{}'".format(key))

for top_level in config:
if top_level not in self.TOP_LEVEL_WHITELIST:
raise AnsibleContainerConfigException("invalid key '{0}'".format(top_level))

if top_level == 'version':
if config['version'] not in self.SUPPORTED_COMPOSE_VERSIONS:
raise AnsibleContainerConfigException("requested version is not supported")
Expand Down
2 changes: 1 addition & 1 deletion container/docker/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ def build_conductor_image(self, base_path, base_image, cache=True):
for filename in ['ansible.cfg', 'ansible-requirements.txt',
'requirements.yml']:
file_path = os.path.join(source_dir, filename)
if os.path.exists(filename):
if os.path.exists(file_path):
tarball.add(file_path,
arcname=os.path.join('build-src', filename))
# Make an empty file just to make sure the build-src dir has something
Expand Down