lock_path = '/var/lib/invirt/cache.lock'
def augment(d1, d2):
- """Splice dict-tree d2 into d1. Return d1.
+ """
+ Splice dict-tree d2 into d1. Return d1.
d2 may be None for an empty dict-tree, because yaml.load produces that.
>>> d
{'a': {'b', 1, 'd': 3}, 'c': 2}
"""
+
if d2 is None:
return d1
for k in d2:
return d1
def run_parts_list(dirname):
- """Reimplements Debian's run-parts --list.
+ """
+ Reimplements Debian's run-parts --list.
One difference from run-parts's behavior: run-parts --list /foo/
will give output like /foo//bar, but run_parts_list('/foo/') gives
Matches documented behavior of run-parts in debianutils v2.28.2, dated 2007.
"""
+
# From run-parts(8).
lanana_re = re.compile('^[a-z0-9]+$')
lsb_re = re.compile('^_?([a-z0-9_.]+-)+[a-z0-9]+$')