trivial: Variable rename
Before doing any work on this, let's use some more meaningful names. Change-Id: I640290359c0c15035187a62da1bc57dba5912b05 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This commit is contained in:
parent
d55acd3ea6
commit
40de09edad
@ -85,21 +85,22 @@ def _get_exclusions(req):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def _is_requirement_in_global_reqs(req, global_reqs):
|
def _is_requirement_in_global_reqs(local_req, global_reqs):
|
||||||
req_exclusions = _get_exclusions(req)
|
req_exclusions = _get_exclusions(local_req)
|
||||||
for req2 in global_reqs:
|
for global_req in global_reqs:
|
||||||
|
|
||||||
matching = True
|
matching = True
|
||||||
for aname in ['package', 'location', 'markers']:
|
for aname in ['package', 'location', 'markers']:
|
||||||
rval = getattr(req, aname)
|
local_req_val = getattr(local_req, aname)
|
||||||
r2val = getattr(req2, aname)
|
global_req_val = getattr(global_req, aname)
|
||||||
if rval != r2val:
|
if local_req_val != global_req_val:
|
||||||
print('WARNING: possible mismatch found for package '
|
print('WARNING: possible mismatch found for package '
|
||||||
'"{}"'.format(req.package))
|
'"{}"'.format(local_req.package))
|
||||||
print(' Attribute "{}" does not match'.format(aname))
|
print(' Attribute "{}" does not match'.format(aname))
|
||||||
print(' "{}" does not match "{}"'.format(rval, r2val))
|
print(' "{}" does not match "{}"'.format(
|
||||||
print(' {}'.format(req))
|
local_req_val, global_req_val))
|
||||||
print(' {}'.format(req2))
|
print(' {}'.format(local_req))
|
||||||
|
print(' {}'.format(global_req))
|
||||||
matching = False
|
matching = False
|
||||||
if not matching:
|
if not matching:
|
||||||
continue
|
continue
|
||||||
@ -107,7 +108,7 @@ def _is_requirement_in_global_reqs(req, global_reqs):
|
|||||||
# This matches the right package and other properties, so
|
# This matches the right package and other properties, so
|
||||||
# ensure that any exclusions are a subset of the global
|
# ensure that any exclusions are a subset of the global
|
||||||
# set.
|
# set.
|
||||||
global_exclusions = _get_exclusions(req2)
|
global_exclusions = _get_exclusions(global_req)
|
||||||
if req_exclusions.issubset(global_exclusions):
|
if req_exclusions.issubset(global_exclusions):
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
@ -119,7 +120,7 @@ def _is_requirement_in_global_reqs(req, global_reqs):
|
|||||||
" Local settings : {}\n"
|
" Local settings : {}\n"
|
||||||
" Global settings: {}\n"
|
" Global settings: {}\n"
|
||||||
" Unexpected : {}".format(
|
" Unexpected : {}".format(
|
||||||
req.package, req_exclusions, global_exclusions,
|
local_req.package, req_exclusions, global_exclusions,
|
||||||
difference)
|
difference)
|
||||||
)
|
)
|
||||||
return False
|
return False
|
||||||
@ -129,7 +130,7 @@ def _is_requirement_in_global_reqs(req, global_reqs):
|
|||||||
"Could not find a global requirements entry to match package {}. "
|
"Could not find a global requirements entry to match package {}. "
|
||||||
"If the package is already included in the global list, "
|
"If the package is already included in the global list, "
|
||||||
"the name or platform markers there may not match the local "
|
"the name or platform markers there may not match the local "
|
||||||
"settings.".format(req.package)
|
"settings.".format(local_req.package)
|
||||||
)
|
)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user