Skip to content

Commit

Permalink
CP Packages on Cent7
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed May 6, 2020
1 parent 87aeb1c commit f01678f
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions serverStatus/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,8 @@ def fetchPackages(request):
upgradePackages.append(pack)

packages = upgradePackages


elif ProcessUtilities.decideDistro() == ProcessUtilities.centos:

### Check Package Lock status
Expand Down Expand Up @@ -823,6 +825,9 @@ def fetchPackages(request):
break
else:
startForUpdate = startForUpdate + 1
elif type == 'CyberPanel':
command = 'cat /usr/local/CyberCP/CPCent7repo.json'
packages = json.loads(ProcessUtilities.outputExecutioner(command))

## make list of packages that need update

Expand Down Expand Up @@ -923,6 +928,24 @@ def fetchPackages(request):
checker = 1
else:
json_data = json_data + ',' + json.dumps(dic)
elif type == 'CyberPanel':

packageName = items['Package']

if packageName.split('.')[0] in locked:
lock = 1
else:
lock = 0

dic = {'package': packageName,
'version': items['Version'], 'lock': lock}

counter = counter + 1
if checker == 0:
json_data = json_data + json.dumps(dic)
checker = 1
else:
json_data = json_data + ',' + json.dumps(dic)


except BaseException as msg:
Expand Down

0 comments on commit f01678f

Please sign in to comment.