Merge "Call dib-run-parts from dib"
This commit is contained in:
commit
f23d22c0c8
instack
@ -26,6 +26,18 @@ from diskimage_builder import element_dependencies
|
|||||||
|
|
||||||
from instack import element
|
from instack import element
|
||||||
|
|
||||||
|
# dib-run-parts has moved in dibv2 to an internal call. We don't
|
||||||
|
# really want to introduce a dependency on dib-utils here. For v1
|
||||||
|
# just call it from path.
|
||||||
|
# Note this is fragile as dib considers this internal
|
||||||
|
_DIB_RUN_PARTS = 'dib-run-parts'
|
||||||
|
try:
|
||||||
|
import diskimage_builder.paths
|
||||||
|
_DIB_RUN_PARTS = os.path.join(diskimage_builder.paths.get_path('lib'),
|
||||||
|
'dib-run-parts')
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger()
|
LOG = logging.getLogger()
|
||||||
|
|
||||||
@ -185,7 +197,7 @@ class ElementRunner(object):
|
|||||||
LOG.debug(" Blacklisting %s" % blacklisted_script)
|
LOG.debug(" Blacklisting %s" % blacklisted_script)
|
||||||
os.unlink(os.path.join(hook_dir, blacklisted_script))
|
os.unlink(os.path.join(hook_dir, blacklisted_script))
|
||||||
|
|
||||||
command = ['dib-run-parts', hook_dir]
|
command = [_DIB_RUN_PARTS, hook_dir]
|
||||||
if self.dry_run:
|
if self.dry_run:
|
||||||
LOG.info(" Dry Run specified, not running hook")
|
LOG.info(" Dry Run specified, not running hook")
|
||||||
else:
|
else:
|
||||||
|
@ -118,7 +118,7 @@ class TestRunner(testtools.TestCase):
|
|||||||
|
|
||||||
self.assertEqual(1, mock_call.call_count)
|
self.assertEqual(1, mock_call.call_count)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
['dib-run-parts',
|
[runner._DIB_RUN_PARTS,
|
||||||
os.path.join(self.runner.tmp_hook_dir, 'install.d')],
|
os.path.join(self.runner.tmp_hook_dir, 'install.d')],
|
||||||
mock_call.call_args_list[0][0][0])
|
mock_call.call_args_list[0][0][0])
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user