Skip to content

Commit

Permalink
YAPF format
Browse files Browse the repository at this point in the history
  • Loading branch information
retr0h committed Mar 30, 2017
1 parent dc09c44 commit 9052d77
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
6 changes: 3 additions & 3 deletions gilt/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ def config(filename):
:parse filename: A string containing the path to YAML file.
:return: list
"""
Config = collections.namedtuple(
'Config',
['git', 'lock_file', 'version', 'name', 'src', 'dst', 'files'])
Config = collections.namedtuple('Config', [
'git', 'lock_file', 'version', 'name', 'src', 'dst', 'files'
])

return [Config(**d) for d in _get_config_generator(filename)]

Expand Down
13 changes: 7 additions & 6 deletions gilt/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ def overlay(repository, files, version, debug=False):
if '*' in fc.src:
for filename in glob.glob(fc.src):
util.copy(filename, fc.dst)
msg = ' - copied ({}) {} to {}'.format(version, filename,
fc.dst)
msg = ' - copied ({}) {} to {}'.format(
version, filename, fc.dst)
util.print_info(msg)
else:
if os.path.isdir(fc.dst) and os.path.isdir(fc.src):
shutil.rmtree(fc.dst)
util.copy(fc.src, fc.dst)
msg = ' - copied ({}) {} to {}'.format(version, fc.src,
fc.dst)
msg = ' - copied ({}) {} to {}'.format(
version, fc.src, fc.dst)
util.print_info(msg)


Expand All @@ -116,8 +116,9 @@ def _get_version(version, debug=False):
:param debug: An optional bool to toggle debug output.
:return: None
"""
if not any((_has_branch(version, debug), _has_tag(version, debug),
_has_commit(version, debug))):
if not any(
(_has_branch(version, debug), _has_tag(version, debug), _has_commit(
version, debug))):
cmd = sh.git.bake('fetch')
util.run_command(cmd, debug=debug)
cmd = sh.git.bake('checkout', version)
Expand Down
4 changes: 2 additions & 2 deletions test/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ def test_config(gilt_config_file):
assert 'master' == r.version
assert 'retr0h.ansible-etcd' == r.name
assert ('.gilt', 'clone', 'retr0h.ansible-etcd') == os_split(r.src)[-3:]
assert ('.gilt', 'lock', 'retr0h.ansible-etcd'
) == os_split(r.lock_file)[-3:]
assert ('.gilt', 'lock',
'retr0h.ansible-etcd') == os_split(r.lock_file)[-3:]
assert ('roles', 'retr0h.ansible-etcd', '') == os_split(r.dst)[-3:]
assert [] == r.files

Expand Down

0 comments on commit 9052d77

Please sign in to comment.