I was curious about how something worked in yum
so I was looking at some of its score code and I found this line in the erasePkgs
function in cli.py.
if False: pass
elif basecmd in ('erase-n', 'remove-n'):
rms = self.remove(name=arg)
.
.
.
The if False: pass
does nothing correct? It never gets into that branch it always just skips to the next one doesn't it?
Here is the link to the source code: https://github.com/rpm-software-management/yum/blob/master/cli.py. It's on line 1268.
Ans: From the server's terminal run the command “subscription-manager status”, it will display the current subscription status and we can also verify the subscription status from Satellite dashboard, Go to the hosts Tab –> then content hosts –> See the subscription details.
To disable a particular repository or repositories, run the following command as the root user: yum-config-manager --disable repository… Alternatively, you can use a global regular expression to disable all matching Yum repositories: yum-config-manager --disable glob_expression…
This appears to be the developer's idiom for a generalized switch statement.
if False: pass
elif basecmd in ('erase-n', 'remove-n'):
rms = self.remove(name=arg)
elif basecmd in ('erase-na', 'remove-na'):
...
elif basecmd in ('erase-nevra', 'remove-nevra'):
...
else:
...
which is ever so slightly more readable than
if basecmd in ('erase-n', 'remove-n'):
rms = self.remove(name=arg)
elif basecmd in ('erase-na', 'remove-na'):
...
elif basecmd in ('erase-nevra', 'remove-nevra'):
...
else:
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With