mirror of
https://github.com/peridotbuild/pv2.git
synced 2024-11-21 20:51:26 +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}'"
|
f"'%_topdir {local_repo_path}'"
|
||||||
]
|
]
|
||||||
command_to_send = ' '.join(command_to_send)
|
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
|
@staticmethod
|
||||||
def pack_srpm(srpm_dir, spec_file, dist_tag):
|
def pack_srpm(srpm_dir, spec_file, dist_tag):
|
||||||
@ -103,6 +106,9 @@ class Import:
|
|||||||
]
|
]
|
||||||
command_to_send = ' '.join(command_to_send)
|
command_to_send = ' '.join(command_to_send)
|
||||||
returned = 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.RpmBuildError(f'There was error packing the rpm:\n\n{rpmerr}')
|
||||||
wrote_regex = r'Wrote:\s+(.*\.rpm)'
|
wrote_regex = r'Wrote:\s+(.*\.rpm)'
|
||||||
regex_search = re.search(wrote_regex, returned.stdout, re.MULTILINE)
|
regex_search = re.search(wrote_regex, returned.stdout, re.MULTILINE)
|
||||||
if regex_search:
|
if regex_search:
|
||||||
|
@ -96,6 +96,7 @@ class ErrorConstants:
|
|||||||
RPM_ERR_OPEN = 9400
|
RPM_ERR_OPEN = 9400
|
||||||
RPM_ERR_SIG = 9401
|
RPM_ERR_SIG = 9401
|
||||||
RPM_ERR_INFO = 9402
|
RPM_ERR_INFO = 9402
|
||||||
|
RPM_ERR_BUILD = 9403
|
||||||
|
|
||||||
# pylint: disable=too-few-public-methods
|
# pylint: disable=too-few-public-methods
|
||||||
class MockConstants:
|
class MockConstants:
|
||||||
|
@ -31,6 +31,7 @@ __all__ = [
|
|||||||
'RpmOpenError',
|
'RpmOpenError',
|
||||||
'RpmSigError',
|
'RpmSigError',
|
||||||
'RpmInfoError',
|
'RpmInfoError',
|
||||||
|
'RpmBuildError',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@ -170,7 +171,12 @@ class RpmSigError(GenericError):
|
|||||||
|
|
||||||
class RpmInfoError(GenericError):
|
class RpmInfoError(GenericError):
|
||||||
"""
|
"""
|
||||||
There was an issue opening the RPM because the signature could not be
|
There was an issue opening the RPM because the RPM is not valid.
|
||||||
verified
|
|
||||||
"""
|
"""
|
||||||
fault_code = errconst.RPM_ERR_INFO
|
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