2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-09-09 14:36:44 +00:00

Remove shadowed duplicate definitions (F811)

Three names were defined twice in the same scope, so the first definition
was unreachable:

- lenovo OEM handler: two set_user_access methods, the second silently
  replacing the first.  That made the SMM privilege update dead code.  The
  conditions are mutually exclusive (is_fpc returns None once has_xcc is
  true), so merge both into the surviving method.
- redfish plugin handle_cert_authorities and prepfish
  disable_host_interface: byte identical copies, drop the redundant one.
This commit is contained in:
Markus Hilger
2026-08-09 07:08:39 +02:00
parent 5d9e30de7b
commit b119de345b
3 changed files with 2 additions and 30 deletions
@@ -409,6 +409,8 @@ class OEMHandler(generic.OEMHandler):
privilege_level):
if await self.is_fpc() and self._fpc_variant != 6:
await self.smmhandler.set_user_priv(uid, privilege_level)
if await self.has_xcc():
await self.immhandler.set_user_access(uid, privilege_level)
async def is_fpc(self):
"""True if the target is a Lenovo nextscale fan power controller"""
@@ -1361,10 +1363,6 @@ class OEMHandler(generic.OEMHandler):
return await self.immhandler.get_user_privilege_level(uid)
return None
async def set_user_access(self, uid, channel, callback, link_auth, ipmi_msg, privilege_level):
if await self.has_xcc():
await self.immhandler.set_user_access(uid, privilege_level)
async def process_zero_fru(self, zerofru):
if (self.oemid['manufacturer_id'] == 19046
and self.oemid['product_id'] == 13616):
@@ -637,28 +637,6 @@ class IpmiHandler:
os.unlink(certname)
await self.ipmicmd.install_bmc_certificate(cert)
async def handle_cert_authorities(self):
if len(self.element) == 3:
if self.op == 'read':
async for cert in self.ipmicmd.get_trusted_cas():
await self.output.put(msg.ChildCollection(cert['id']))
elif self.op == 'update':
cert = self.inputdata.get_pem(self.node)
await self.ipmicmd.add_trusted_ca(cert)
elif len(self.element) == 4:
certid = self.element[-1]
if self.op == 'read':
async for certdata in self.ipmicmd.get_trusted_cas():
if certdata['id'] == certid:
await self.output.put(msg.CertificateAuthority(
pem=certdata['pem'],
node=self.node,
subject=certdata['subject'],
san=certdata.get('san', None)))
elif self.op == 'delete':
await self.ipmicmd.del_trusted_ca(certid)
return
async def handle_alerts(self):
if self.element[3] == 'destinations':
if len(self.element) == 4:
-4
View File
@@ -232,10 +232,6 @@ def dotwait():
sys.stderr.flush()
time.sleep(0.5)
def disable_host_interface():
s = Session('/dev/ipmi0')
s.raw_command(netfn=0xc, command=1, data=(1, 0xc1, 0))
def get_redfish_creds():
os.makedirs('/run/redfish', exist_ok=True, mode=0o700)
try: