Merge pull request #4 from tomstuart/be-friendlier-about-missing-fig-yml
Be friendlier about missing `fig.yml`
This commit is contained in:
commit
d8a2a0f003
1 changed files with 11 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
from docker import Client
|
from docker import Client
|
||||||
|
import errno
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
@ -18,7 +19,16 @@ class Command(DocoptCommand):
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def project(self):
|
def project(self):
|
||||||
config = yaml.load(open('fig.yml'))
|
try:
|
||||||
|
config = yaml.load(open('fig.yml'))
|
||||||
|
except IOError, e:
|
||||||
|
if e.errno == errno.ENOENT:
|
||||||
|
log.error("Can't find %s. Are you in the right directory?", e.filename)
|
||||||
|
else:
|
||||||
|
log.error(e)
|
||||||
|
|
||||||
|
exit(1)
|
||||||
|
|
||||||
return Project.from_config(self.project_name, config, self.client)
|
return Project.from_config(self.project_name, config, self.client)
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue