Skip to content
Permalink
Browse files

bug fix to cPanel Importer: DNS

  • Loading branch information...
usmannasir committed Aug 17, 2019
1 parent 438f167 commit b26ad92f95bce9da1e8625934743f9fbe66daf0d
@@ -539,10 +539,18 @@ def CreateDNSRecords(self):
RecordsData[4] = ipAddress

if RecordsData[0].find(topLevelDomain) > -1:
DNS.createDNSRecord(zone, RecordsData[0].replace('.', ''), RecordsData[3], RecordsData[4], 0, RecordsData[1])
if RecordsData[3] == 'MX':
DNS.createDNSRecord(zone, RecordsData[0].rstrip('.'), RecordsData[3],RecordsData[5].rstrip('.').rstrip('.\n'), int(RecordsData[4]), RecordsData[1])
else:
DNS.createDNSRecord(zone, RecordsData[0].rstrip('.'), RecordsData[3], RecordsData[4].rstrip('.').rstrip('.\n'), 0, RecordsData[1])
else:
DNS.createDNSRecord(zone, RecordsData[0] + '.' + topLevelDomain , RecordsData[3], RecordsData[4], 0,
RecordsData[1])
if RecordsData[3] == 'MX':
DNS.createDNSRecord(zone, RecordsData[0] + '.' + topLevelDomain, RecordsData[3],
RecordsData[5].rstrip('.').rstrip('.\n'), RecordsData[4],
RecordsData[1])
else:
DNS.createDNSRecord(zone, RecordsData[0] + '.' + topLevelDomain , RecordsData[3], RecordsData[4].rstrip('.').rstrip('.\n'), 0,
RecordsData[1])
except BaseException, msg:
message = 'Failed while creating DNS entry for %s, error message: %s.' % (topLevelDomain, str(msg))
logging.statusWriter(self.logFile, message, 1)
@@ -78,7 +78,7 @@ <h2 style="display: inline; color: #414C59;" ng-bind="web.domain"></h2>

<div class="col-md-4 content-box-header">
<i class="p fa fa-hdd-o btn-icon text-muted" data-toggle="tooltip" data-placement="right"
title="Email">&emsp;</i>
title="Disk Usage">&emsp;</i>
<span ng-bind="web.diskUsed" style="text-transform: none"></span>
</div>

@@ -2049,8 +2049,11 @@ def searchWebsitesJson(self, currentlACL, userID, searchTerm):
state = "Suspended"
else:
state = "Active"

diskUsed = "%sMB" % str(
virtualHostUtilities.getDiskUsage("/home/" + items.domain, items.package.diskSpace)[0])
dic = {'domain': items.domain, 'adminEmail': items.adminEmail, 'ipAddress': ipAddress,
'admin': items.admin.userName, 'package': items.package.packageName, 'state': state}
'admin': items.admin.userName, 'package': items.package.packageName, 'state': state, 'diskUsed': diskUsed}

if checker == 0:
json_data = json_data + json.dumps(dic)

0 comments on commit b26ad92

Please sign in to comment.
You can’t perform that action at this time.