Skip to content

Commit f01678f

Browse files
committed
CP Packages on Cent7
1 parent 87aeb1c commit f01678f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

serverStatus/views.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,8 @@ def fetchPackages(request):
753753
upgradePackages.append(pack)
754754

755755
packages = upgradePackages
756+
757+
756758
elif ProcessUtilities.decideDistro() == ProcessUtilities.centos:
757759

758760
### Check Package Lock status
@@ -823,6 +825,9 @@ def fetchPackages(request):
823825
break
824826
else:
825827
startForUpdate = startForUpdate + 1
828+
elif type == 'CyberPanel':
829+
command = 'cat /usr/local/CyberCP/CPCent7repo.json'
830+
packages = json.loads(ProcessUtilities.outputExecutioner(command))
826831

827832
## make list of packages that need update
828833

@@ -923,6 +928,24 @@ def fetchPackages(request):
923928
checker = 1
924929
else:
925930
json_data = json_data + ',' + json.dumps(dic)
931+
elif type == 'CyberPanel':
932+
933+
packageName = items['Package']
934+
935+
if packageName.split('.')[0] in locked:
936+
lock = 1
937+
else:
938+
lock = 0
939+
940+
dic = {'package': packageName,
941+
'version': items['Version'], 'lock': lock}
942+
943+
counter = counter + 1
944+
if checker == 0:
945+
json_data = json_data + json.dumps(dic)
946+
checker = 1
947+
else:
948+
json_data = json_data + ',' + json.dumps(dic)
926949

927950

928951
except BaseException as msg:

0 commit comments

Comments
 (0)