mirror of
https://github.com/peridotbuild/pv2.git
synced 2024-12-22 02:38:31 +00:00
hotfix: add returncode checks for operator
This commit is contained in:
parent
32f0c3520c
commit
bcea55337f
@ -80,7 +80,10 @@ class Import:
|
||||
f"'%_topdir {local_repo_path}'"
|
||||
]
|
||||
command_to_send = ' '.join(command_to_send)
|
||||
processor.run_proc_no_output_shell(command_to_send)
|
||||
returned = processor.run_proc_no_output_shell(command_to_send)
|
||||
if returned != 0:
|
||||
rpmerr = returned.stderr
|
||||
raise err.RpmOpenError(f'This package could not be unpacked:\n\n{rpmerr}')
|
||||
|
||||
@staticmethod
|
||||
def pack_srpm(srpm_dir, spec_file, dist_tag):
|
||||
@ -103,6 +106,9 @@ class Import:
|
||||
]
|
||||
command_to_send = ' '.join(command_to_send)
|
||||
returned = processor.run_proc_no_output_shell(command_to_send)
|
||||
if returned != 0:
|
||||
rpmerr = returned.stderr
|
||||
raise err.RpmBuildError(f'There was error packing the rpm:\n\n{rpmerr}')
|
||||
wrote_regex = r'Wrote:\s+(.*\.rpm)'
|
||||
regex_search = re.search(wrote_regex, returned.stdout, re.MULTILINE)
|
||||
if regex_search:
|
||||
|
@ -96,6 +96,7 @@ class ErrorConstants:
|
||||
RPM_ERR_OPEN = 9400
|
||||
RPM_ERR_SIG = 9401
|
||||
RPM_ERR_INFO = 9402
|
||||
RPM_ERR_BUILD = 9403
|
||||
|
||||
# pylint: disable=too-few-public-methods
|
||||
class MockConstants:
|
||||
|
@ -31,6 +31,7 @@ __all__ = [
|
||||
'RpmOpenError',
|
||||
'RpmSigError',
|
||||
'RpmInfoError',
|
||||
'RpmBuildError',
|
||||
]
|
||||
|
||||
|
||||
@ -170,7 +171,12 @@ class RpmSigError(GenericError):
|
||||
|
||||
class RpmInfoError(GenericError):
|
||||
"""
|
||||
There was an issue opening the RPM because the signature could not be
|
||||
verified
|
||||
There was an issue opening the RPM because the RPM is not valid.
|
||||
"""
|
||||
fault_code = errconst.RPM_ERR_INFO
|
||||
|
||||
class RpmBuildError(GenericError):
|
||||
"""
|
||||
There was an issue building or packing the RPM.
|
||||
"""
|
||||
fault_code = errconst.RPM_ERR_BUILD
|
||||
|
Loading…
Reference in New Issue
Block a user