Skip to content

Commit

Permalink
impove rpm_manage
Browse files Browse the repository at this point in the history
  • Loading branch information
brsf11 committed Oct 28, 2022
1 parent c4239b8 commit 9520e63
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libs/locallibs/rpm_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ def rpm_install(pkgs, node=1, tmpfile=""):
mugen_log.logging("info", "pkgs:(%s) is already installed" % pkgs)
return 0, None

if "Error: Unable to find a match:" in result:
split_result = result.split('\n')
for row in split_result:
if "Error: Unable to find a match:" in row:
lost_pkgs = row.replace("Error: Unable to find a match: ",'')
mugen_log.logging("Error", "pkgs:(%s) not found" % lost_pkgs)
return 0, None

repoCode, repoList = func(
conn=conn,
cmd="dnf repolist | awk '{print $NF}' | sed -e '1d;:a;N;$!ba;s/\\n/ /g'",
Expand Down

0 comments on commit 9520e63

Please sign in to comment.