Helpful cleanups.

1. Ensure the changelog is in ascii
2. Allow post-download patches to come from a directory instead of from a single set of files.
3. Allow rpm patches to come from a directory instead of a single list of files
4. Update smithy so that the epel rpm location can come from somewhere not epel (if desired)
5. Ensure we cleanup the 'negative' phase files correctly at the various phases.
This commit is contained in:
Joshua Harlow
2012-10-26 17:07:19 -07:00
parent 857bc0c9fd
commit 9697e7c2f9
12 changed files with 191 additions and 37 deletions

View File

@@ -56,6 +56,7 @@ class InstallAction(action.Action):
logger=LOG)
def _run(self, persona, component_order, instances):
removals = []
self._run_phase(
PhaseFunctors(
start=lambda i: LOG.info('Downloading %s.', colorizer.quote(i.name)),
@@ -64,8 +65,22 @@ class InstallAction(action.Action):
),
component_order,
instances,
"download"
"download",
*removals
)
self._run_phase(
PhaseFunctors(
start=lambda i: LOG.info('Post-download patching %s.', colorizer.quote(i.name)),
run=lambda i: i.patch("download"),
end=None,
),
component_order,
instances,
"download-patch",
*removals
)
removals += ['uninstall', 'unconfigure']
self._run_phase(
PhaseFunctors(
start=lambda i: LOG.info('Configuring %s.', colorizer.quote(i.name)),
@@ -75,7 +90,7 @@ class InstallAction(action.Action):
component_order,
instances,
"configure",
'unconfigure'
*removals
)
if self.only_configure:
@@ -85,6 +100,7 @@ class InstallAction(action.Action):
LOG.info("Exiting early, only asked to download and configure!")
return
removals += ['pre-uninstall', 'post-uninstall']
self._run_phase(
PhaseFunctors(
start=lambda i: LOG.info('Preinstalling %s.', colorizer.quote(i.name)),
@@ -93,7 +109,8 @@ class InstallAction(action.Action):
),
component_order,
instances,
"pre-install"
"pre-install",
*removals
)
def install_start(instance):
@@ -120,7 +137,7 @@ class InstallAction(action.Action):
component_order,
instances,
"install",
'uninstall'
*removals
)
self._run_phase(
PhaseFunctors(
@@ -131,5 +148,5 @@ class InstallAction(action.Action):
component_order,
instances,
"post-install",
'uninstall', 'unconfigure', 'pre-uninstall', 'post-uninstall'
*removals
)

View File

@@ -29,6 +29,7 @@ class StartAction(action.Action):
return 'running'
def _run(self, persona, component_order, instances):
removals = []
self._run_phase(
PhaseFunctors(
start=None,
@@ -38,7 +39,9 @@ class StartAction(action.Action):
component_order,
instances,
"pre-start",
*removals
)
removals += ['stopped']
self._run_phase(
PhaseFunctors(
start=lambda i: LOG.info('Starting %s.', i.name),
@@ -48,7 +51,7 @@ class StartAction(action.Action):
component_order,
instances,
"start",
'stopped'
*removals
)
self._run_phase(
PhaseFunctors(
@@ -59,5 +62,5 @@ class StartAction(action.Action):
component_order,
instances,
"post-start",
'stopped'
*removals
)

View File

@@ -34,6 +34,7 @@ class StopAction(action.Action):
return components
def _run(self, persona, component_order, instances):
removals = ['pre-start', 'start', 'post-start']
self._run_phase(
PhaseFunctors(
start=lambda i: LOG.info('Stopping %s.', colorizer.quote(i.name)),
@@ -43,5 +44,5 @@ class StopAction(action.Action):
component_order,
instances,
"stopped",
'pre-start', 'start', 'post-start'
*removals
)

View File

@@ -34,6 +34,7 @@ class UninstallAction(action.Action):
return components
def _run(self, persona, component_order, instances):
removals = ['configure']
self._run_phase(
PhaseFunctors(
start=lambda i: LOG.info('Unconfiguring %s.', colorizer.quote(i.name)),
@@ -43,8 +44,9 @@ class UninstallAction(action.Action):
component_order,
instances,
'unconfigure',
'configure'
*removals
)
removals += ['post-install']
self._run_phase(
PhaseFunctors(
start=None,
@@ -54,8 +56,9 @@ class UninstallAction(action.Action):
component_order,
instances,
'pre-uninstall',
'post-install'
*removals
)
removals += ['install']
self._run_phase(
PhaseFunctors(
start=lambda i: LOG.info('Uninstalling %s.', colorizer.quote(i.name)),
@@ -65,8 +68,9 @@ class UninstallAction(action.Action):
component_order,
instances,
'uninstall',
'install'
*removals
)
removals += ['download', 'configure', "download-patch", 'pre-install', 'post-install']
self._run_phase(
PhaseFunctors(
start=lambda i: LOG.info('Post-uninstalling %s.', colorizer.quote(i.name)),
@@ -76,5 +80,5 @@ class UninstallAction(action.Action):
component_order,
instances,
'post-uninstall',
'download', 'configure', 'pre-install', 'install', 'post-install'
*removals
)