Skip to content

Commit 7c45dfd

Browse files
authored
Merge pull request #28 from shibutd/cloudlinux
Change certain DNF command failures to throw StopActorExecutionError …
2 parents ffba452 + e6895c8 commit 7c45dfd

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

repos/system_upgrade/common/libraries/dnfconfig.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,16 @@ def _set_excluded_pkgs(context, pkglist, disable_plugins):
105105

106106
try:
107107
context.call(cmd)
108-
except CalledProcessError:
108+
except CalledProcessError as e:
109109
api.current_logger().error('Cannot set the dnf configuration')
110-
raise
110+
raise StopActorExecutionError(
111+
message='Cannot set the DNF configuration with the command: {}'.format(cmd),
112+
details={
113+
'details': 'An exception raised: {}'.format(str(e)),
114+
'stdout': e.stdout,
115+
'stderr': e.stderr
116+
}
117+
)
111118
api.current_logger().debug('The DNF configuration has been updated to exclude leapp packages.')
112119

113120

@@ -147,7 +154,14 @@ def _set_repository_state(context, repo_id, new_state):
147154

148155
try:
149156
context.call(cmd)
150-
except CalledProcessError:
157+
except CalledProcessError as e:
151158
api.current_logger().error('Cannot set the dnf configuration')
152-
raise
159+
raise StopActorExecutionError(
160+
message='Cannot set the DNF configuration with the command: {}'.format(cmd),
161+
details={
162+
'details': 'An exception raised: {}'.format(str(e)),
163+
'stdout': e.stdout,
164+
'stderr': e.stderr
165+
}
166+
)
153167
api.current_logger().debug('Repository {} has been {}'.format(repo_id, new_state))

0 commit comments

Comments
 (0)