Skip to content

Commit a179232

Browse files
authored
Merge pull request #9 from singularityhub/fix/yaml
bug fix to yaml version
2 parents 6fdd798 + 8e768c5 commit a179232

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ and **Merged pull requests**. Critical items to know are:
1414
The versions coincide with releases on pypi.
1515

1616
## [0.0.x](https://github.com/singularityhub/singularity-compose/tree/master) (0.0.x)
17+
- pyaml version should be for newer kind, and still check for attribute (0.0.11)
1718
- alpha release with simple (single container) working example (0.0.1)
1819
- dummy release (0.0.0)

scompose/project/instance.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,17 @@ def run_post(self):
206206
if not isinstance(command, list):
207207
command = shlex.split(command)
208208

209-
self.client._run_command(command, quiet=True)
209+
# Capture the return code
210+
response = self.client._run_command(command,
211+
quiet=True,
212+
return_result=True)
213+
# If debug on, show output
214+
bot.debug("".join(response['message']))
215+
216+
# Alert the user if there is an error
217+
if response['return_code'] != 0:
218+
bot.error("".join(response['message']))
219+
bot.exit("Return code %s, exiting." % response['return_code'])
210220

211221
# Image
212222

scompose/utils/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,13 @@ def _read_yaml(section, quiet=False):
149149
section: a string of unparsed yaml content.
150150
'''
151151
metadata = {}
152-
docs = yaml.load_all(section, Loader=yaml.FullLoader)
152+
153+
# PyYaml vs pyaml have subtle differences
154+
if hasattr(yaml, "FullLoader"):
155+
docs = yaml.load_all(section, Loader=yaml.FullLoader)
156+
else:
157+
docs = yaml.load_all(section)
158+
153159
for doc in docs:
154160
if isinstance(doc, dict):
155161
for k, v in doc.items():

scompose/version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
1818
'''
1919

20-
__version__ = "0.0.1"
20+
__version__ = "0.0.11"
2121
AUTHOR = 'Vanessa Sochat'
2222
AUTHOR_EMAIL = '[email protected]'
2323
NAME = 'singularity-compose'
@@ -32,7 +32,7 @@
3232

3333
INSTALL_REQUIRES = (
3434
('spython', {'min_version': '0.0.67'}),
35-
('pyaml', {'min_version': '17.12.1'}),
35+
('pyaml', {'min_version': '5.1.1'}),
3636
)
3737

3838
TESTS_REQUIRES = (

0 commit comments

Comments
 (0)