Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
b895cf9
DB : Add support for MySQL 8
davidjumani May 11, 2020
83e8662
Adding centos8 packaging
davidjumani May 18, 2020
363ad68
Ubuntu 20.04: mask systemd socket services
ustcweizhou Apr 27, 2020
9fef4a3
Ubuntu 20.04: Specify image format of backing file
ustcweizhou Apr 27, 2020
fc7113e
Migrating cloudutils to python3
davidjumani May 18, 2020
28b1a2b
agent specific changes
shwstppr May 11, 2020
e456aa0
script fixes
shwstppr May 15, 2020
7f11aaa
agent: kvm - remove bridge-utils dependency
davidjumani May 18, 2020
67f40b5
Management scripts migrated to python3
davidjumani May 18, 2020
6f34877
fix sql_mode in default db.properties
rohityadavcloud Apr 29, 2020
7da9e36
fix dupe
rohityadavcloud Apr 30, 2020
363dca8
fixes
shwstppr May 19, 2020
8fee260
wrong edit
shwstppr May 19, 2020
91cc6ed
revert serverTimezone removal
shwstppr May 19, 2020
8c1d840
python3 stdout fixes
shwstppr May 20, 2020
4ba7a6a
Fixing centos7 packaging
davidjumani May 20, 2020
3d99234
engine/schema: add empty DB upgrade path from 4.14.0.0 to 4.15.0.0
shwstppr May 20, 2020
d1daf94
fix
shwstppr May 20, 2020
9d92e44
Merge branch 'master' into adding-centos8-support
shwstppr May 20, 2020
c2bfe0a
Merge branch 'upgrade-path-415' into adding-centos8-support
shwstppr May 20, 2020
edb686e
Fixing broken dependency
davidjumani May 20, 2020
cd6b0aa
schema: nics table fix
shwstppr May 21, 2020
1868560
packaging: ignore python, revert todo
shwstppr May 26, 2020
b7bfc59
Changing pythondir for debian
davidjumani May 26, 2020
2eebb29
Merge branch 'master' into adding-centos8-support
shwstppr May 27, 2020
6e2b6ce
Adding python3 dependency to debian packaging
davidjumani May 27, 2020
2439c19
fix
shwstppr May 27, 2020
77ae1af
added pip3 package installation
shwstppr May 28, 2020
232b27d
move pip3 install to package dependency
shwstppr May 28, 2020
a7af72f
temp install unavailable packages using pip3
shwstppr May 28, 2020
3ba1053
fix
shwstppr May 28, 2020
ea14008
changed site-packages location for centos7
shwstppr May 28, 2020
8e32b08
Adding default value for nics table
davidjumani May 29, 2020
95cb96c
pip3 installation not needed
shwstppr May 29, 2020
68b0e9e
debian distutils fix
shwstppr May 29, 2020
334baa7
add debian dependencies
shwstppr May 29, 2020
e0b7d20
removed unused packages
shwstppr Jun 1, 2020
e6a517e
removed temp TODO changes
shwstppr Jun 2, 2020
8785f14
remove pip3 installation from debian pkg
shwstppr Jun 3, 2020
dfb563c
Merge branch 'master' into adding-centos8-support
shwstppr Jun 4, 2020
9b324f7
use RSA 2048 bit for centos8 crypto-policy/java.conf
shwstppr Jun 4, 2020
fc90e1a
fix
shwstppr Jun 5, 2020
eea8af9
fix for backup snapshot newer QEMU
shwstppr Jun 10, 2020
c9c829b
fix
shwstppr Jun 10, 2020
8046edf
missing condition
shwstppr Jun 10, 2020
04e241a
fix
shwstppr Jun 10, 2020
41a69cb
fix centos relsease specific python dependencies grab
shwstppr Jun 11, 2020
3043e6e
addressed review comments
shwstppr Jun 11, 2020
2b6edac
from logging: Logging framework to use only log4j #4003
shwstppr Jun 22, 2020
e578fb4
remove python2 dep
shwstppr Jun 22, 2020
b9edc95
hypervisor: XCP-ng 8.1 support
rohityadavcloud Jun 24, 2020
21d5dcd
Merge remote-tracking branch 'origin/master' into adding-centos8-support
rohityadavcloud Jun 24, 2020
bc48e2e
install mysql python connector through python wheel
shwstppr Jun 25, 2020
b64c4c0
fix
shwstppr Jun 25, 2020
f38d544
pip install after package install
shwstppr Jun 25, 2020
6631623
Merge branch 'master' into adding-centos8-support
shwstppr Jun 25, 2020
5b82a1c
fix snapshot issue
shwstppr Jun 26, 2020
cd5d569
test suppress 143 exit code
shwstppr Jun 26, 2020
0987687
revert last commit
shwstppr Jun 26, 2020
1450259
Removing todo
davidjumani Jun 29, 2020
a00c42d
revert ip to brctl
shwstppr Jun 30, 2020
e14ecf4
python mysql connect
shwstppr Jun 30, 2020
70be0f9
use new mysql-connector-python, revert auth_plugin changes
shwstppr Jul 1, 2020
667fdf4
latest mysql-connector-python for centos7
shwstppr Jul 2, 2020
7eda2da
marvin use whl install for mysql-connector-python
shwstppr Jul 2, 2020
36d9e5e
configure hugepages before test
shwstppr Jul 6, 2020
fa2a72a
temp check to use qemu-img with shared read
shwstppr Jul 7, 2020
3ae3b1c
Merge branch 'master' into adding-centos8-support
rohityadavcloud Jul 7, 2020
508a436
revert qemu-img change
shwstppr Jul 7, 2020
1a042a7
wait between attach-detach
shwstppr Jul 7, 2020
8ffea7c
Merge branch 'master' and use default test_data timeout in volumes test
shwstppr Jul 8, 2020
9c2163d
Merge branch 'master' into adding-centos8-support
shwstppr Jul 20, 2020
d85f995
use test template
shwstppr Jul 8, 2020
8dec6a8
print skip mounting message
shwstppr Jul 21, 2020
5f816b2
code review refactoring
shwstppr Aug 4, 2020
1e0af9a
missed
shwstppr Aug 4, 2020
38c07f3
append db name
shwstppr Aug 5, 2020
245cf1b
decode bytearray
shwstppr Aug 12, 2020
2739e71
Minor fixes
davidjumani Aug 12, 2020
ff1c023
Merge branch 'master' into adding-centos8-support
shwstppr Aug 13, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions agent/bindir/cloud-guest-tool.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
Expand Down Expand Up @@ -78,7 +78,7 @@ class GuestCommand:
info['network'] = 'guest-network-get-interfaces'

result = dict()
for key, cmd in info.items():
for key, cmd in list(info.items()):
result[key] = self.virt.agent_command(self.dom, cmd)

return result, 0
Expand Down
40 changes: 20 additions & 20 deletions agent/bindir/cloud-setup-agent.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
Expand Down Expand Up @@ -31,56 +31,56 @@ from cloudutils.serviceConfig import configureLibvirtConfig
from optparse import OptionParser

def getUserInputs():
print "Welcome to the CloudStack Agent Setup:"
print("Welcome to the CloudStack Agent Setup:")

cfo = configFileOps("@AGENTSYSCONFDIR@/agent.properties")
oldMgt = cfo.getEntry("host")

mgtSvr = raw_input("Please input the Management Server Hostname/IP-Address:[%s]"%oldMgt)
mgtSvr = input("Please input the Management Server Hostname/IP-Address:[%s]"%oldMgt)
if mgtSvr == "":
mgtSvr = oldMgt
try:
socket.getaddrinfo(mgtSvr, 443)
except:
print "Failed to resolve %s. Please input a valid hostname or IP-Address."%mgtSvr
print("Failed to resolve %s. Please input a valid hostname or IP-Address."%mgtSvr)
exit(1)

oldToken = cfo.getEntry("zone")
zoneToken = raw_input("Please input the Zone Id:[%s]"%oldToken)
zoneToken = input("Please input the Zone Id:[%s]"%oldToken)

if zoneToken == "":
zoneToken = oldToken

oldPod = cfo.getEntry("pod")
podId = raw_input("Please input the Pod Id:[%s]"%oldPod)
podId = input("Please input the Pod Id:[%s]"%oldPod)

if podId == "":
podId = oldToken

oldCluster = cfo.getEntry("cluster")
clusterId = raw_input("Please input the Cluster Id:[%s]"%oldCluster)
clusterId = input("Please input the Cluster Id:[%s]"%oldCluster)
if clusterId == "":
clusterId = oldCluster

oldHypervisor = cfo.getEntry("hypervisor")
if oldHypervisor == "":
oldHypervisor = "kvm"

hypervisor = raw_input("Please input the Hypervisor type kvm/lxc:[%s]"%oldHypervisor)
hypervisor = input("Please input the Hypervisor type kvm/lxc:[%s]"%oldHypervisor)
if hypervisor == "":
hypervisor = oldHypervisor

try:
defaultNic = networkConfig.getDefaultNetwork()
except:
print "Failed to get default route. Please configure your network to have a default route"
print("Failed to get default route. Please configure your network to have a default route")
exit(1)

defNic = defaultNic.name
network = raw_input("Please choose which network used to create VM:[%s]"%defNic)
network = input("Please choose which network used to create VM:[%s]"%defNic)
if network == "":
if defNic == "":
print "You need to specifiy one of Nic or bridge on your system"
print("You need to specifiy one of Nic or bridge on your system")
exit(1)
elif network == "":
network = defNic
Expand Down Expand Up @@ -115,7 +115,7 @@ if __name__ == '__main__':

if not options.auto and options.secure:
configureLibvirtConfig(True)
print "Libvirtd with TLS configured"
print("Libvirtd with TLS configured")
sys.exit(0)

if options.auto is None:
Expand All @@ -131,10 +131,10 @@ if __name__ == '__main__':
if glbEnv.uuid == "":
glbEnv.uuid = bash("uuidgen").getStdout()
else:
for para, value in options.__dict__.items():
for para, value in list(options.__dict__.items()):
if value is None:
print "Missing operand:%s"%para
print "Try %s --help for more information"%sys.argv[0]
print("Missing operand:%s"%para)
print("Try %s --help for more information"%sys.argv[0])
sys.exit(1)

glbEnv.uuid = options.guid
Expand All @@ -149,14 +149,14 @@ if __name__ == '__main__':

glbEnv.secure = options.secure

print "Starting to configure your system:"
print("Starting to configure your system:")
syscfg = sysConfigFactory.getSysConfigFactory(glbEnv)
try:
syscfg.config()
print "CloudStack Agent setup is done!"
except (CloudRuntimeException,CloudInternalException), e:
print e
print "Try to restore your system:"
print("CloudStack Agent setup is done!")
except (CloudRuntimeException,CloudInternalException) as e:
print(e)
print("Try to restore your system:")
try:
syscfg.restore()
except:
Expand Down
16 changes: 8 additions & 8 deletions agent/bindir/cloudstack-agent-upgrade.in
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/usr/bin/python
#!/usr/bin/python3
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand All @@ -32,7 +32,7 @@ def upgradeBridgeName(brName, enslavedDev):
print("find physical device %s"%phyDev)
newBrName = "br" + phyDev + "-" + vlanId
print("new bridge name %s"%newBrName)
bash("ip link set %s down"%brName)
bash("ip link set %s down"%brName)
bash("ip link set %s name %s"%(brName, newBrName))
bash("ip link set %s up" %newBrName)
cmd = "iptables-save | grep FORWARD | grep -w " + brName
Expand All @@ -47,16 +47,16 @@ def upgradeBridgeName(brName, enslavedDev):
except:
logging.exception("Ignoring failure to update rules for rule " + rule + " on bridge " + brName)
if __name__ == '__main__':
netlib = networkConfig()
netlib = networkConfig()
bridges = netlib.listNetworks()
bridges = filter(isOldStyleBridge, bridges)
bridges = list(filter(isOldStyleBridge, bridges))
for br in bridges:
enslavedDev = netlib.getEnslavedDev(br, 1)
if enslavedDev is not None:
upgradeBridgeName(br, enslavedDev)

bridges = netlib.listNetworks()
bridges = filter(isOldStyleBridge, bridges)
bridges = list(filter(isOldStyleBridge, bridges))
if len(bridges) > 0:
print("Warning: upgrade is not finished, still some bridges have the old style name:" + str(bridges))
else:
Expand Down
9 changes: 4 additions & 5 deletions agent/bindir/libvirtqemuhook.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
Expand Down Expand Up @@ -32,7 +32,7 @@ logging.basicConfig(filename='/var/log/libvirt/qemu-hook.log',
logger = logging.getLogger('qemu-hook')

customDir = "/etc/libvirt/hooks/custom"
customDirPermissions = 0744
customDirPermissions = 0o744
timeoutSeconds = 10 * 60
validQemuActions = ['prepare', 'start', 'started', 'stopped', 'release', 'migrate', 'restore', 'reconnect', 'attach']

Expand Down Expand Up @@ -128,9 +128,8 @@ def terminateProcess(process, scriptName):


def getCustomScriptsFromDirectory():
return sorted(filter(lambda fileName: (fileName is not None) & (fileName != "") & ('_' in fileName) &
(fileName.startswith((action + '_')) | fileName.startswith(('all' + '_'))),
os.listdir(customDir)), key=lambda fileName: substringAfter(fileName, '_'))
return sorted([fileName for fileName in os.listdir(customDir) if (fileName is not None) & (fileName != "") & ('_' in fileName) &
(fileName.startswith((action + '_')) | fileName.startswith(('all' + '_')))], key=lambda fileName: substringAfter(fileName, '_'))


def substringAfter(s, delimiter):
Expand Down
4 changes: 2 additions & 2 deletions agent/bindir/rolling-maintenance.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On line 79 and 83/84 - the error is thrown "Unexpected error on systemd service: write() argument must be str, not bytes".

This needs to be fixed, and also, the output given in the API and also inside the rolling-maintenance.log (on the KVM host) is prepended with letter b, and appended with \n

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i.e. 20:50:23,239 rolling-maintenance INFO b'preflight stage' (from the log)
or
"output": "b'This is Maintenance Stage'\n", (from the API output)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest commit should solve this

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
Expand Down Expand Up @@ -43,7 +43,7 @@ def execute_script(stage, script, payload, timeout):

success = True if exitStatus == 0 or exitStatus == AVOID_MAINTENANCE_EXIT_STATUS else False
avoid_maintenance = True if exitStatus == AVOID_MAINTENANCE_EXIT_STATUS else False
return {"success": success, "message": stdout.strip(), "avoidmaintenance": avoid_maintenance}
return {"success": success, "message": stdout.decode('utf-8').strip(), "avoidmaintenance": avoid_maintenance}
except Exception as e:
logger.error("Error in stage %s: %s" % (script, e))
sys.exit(1)
Expand Down
20 changes: 10 additions & 10 deletions client/bindir/cloud-setup-management.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
Expand Down Expand Up @@ -35,26 +35,26 @@ if __name__ == '__main__':
if options.https:
glbEnv.svrMode = "HttpsServer"
if options.tomcat7:
print "The --tomcat7 option is deprecated, CloudStack now uses embedded Jetty server."
print("The --tomcat7 option is deprecated, CloudStack now uses embedded Jetty server.")
if options.nostart:
glbEnv.noStart = True

glbEnv.mode = "Server"

print "Starting to configure CloudStack Management Server:"
print("Starting to configure CloudStack Management Server:")
try:
syscfg = sysConfigFactory.getSysConfigFactory(glbEnv)
except UnknownSystemException:
print >>sys.stderr, ("Error: CloudStack failed to detect your "
"operating system. Exiting.")
print(("Error: CloudStack failed to detect your "
"operating system. Exiting."), file=sys.stderr)
sys.exit(1)
try:
syscfg.registerService(cloudManagementConfig)
syscfg.registerService(cloudManagementConfig)
syscfg.config()
print "CloudStack Management Server setup is Done!"
except (CloudRuntimeException, CloudInternalException), e:
print e
print "Try to restore your system:"
print("CloudStack Management Server setup is Done!")
except (CloudRuntimeException, CloudInternalException) as e:
print(e)
print("Try to restore your system:")
try:
syscfg.restore()
except:
Expand Down
24 changes: 12 additions & 12 deletions client/bindir/cloud-update-xenserver-licenses.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python -W ignore::DeprecationWarning
#!/usr/bin/python3 -W ignore::DeprecationWarning
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
Expand Down Expand Up @@ -65,7 +65,7 @@ def getknownhosts(host,username,password):
usernames = dict(cur.fetchall())
cur.execute("SELECT h.private_ip_address,d.value FROM cloud.host h inner join cloud.host_details d on (h.id = d.host_id) where d.name = 'password' and setup = 1")
passwords = dict(cur.fetchall())
creds = dict( [ [x,(usernames[x],passwords[x])] for x in usernames.keys() ] )
creds = dict( [ [x,(usernames[x],passwords[x])] for x in list(usernames.keys()) ] )
cur.close()
conn.close()
return creds
Expand Down Expand Up @@ -121,7 +121,7 @@ class XenServerConfigurator(Thread):
if self.retval != 0: self.state = 'failed'
else: self.state = 'finished'

except Exception,e:
except Exception as e:
self.state = 'failed'
self.retval = e
#raise
Expand All @@ -144,39 +144,39 @@ if options.all:
if len(args) != 0: e("IP addresses cannot be specified if -a is specified")
config = read_properties(cfg)
creds = getknownhosts(config["db.cloud.host"],config["db.cloud.username"],config["db.cloud.password"])
hosts = creds.keys()
hosts = list(creds.keys())
else:
if not args: e("You must specify at least one IP address, or -a")
hosts = args
creds = parseuserpwfromhosts(hosts)

try:
keyfiledata = file(licensefile).read(-1)
except OSError,e:
except OSError as e:
sys.stderr.write("The file %s cannot be opened"%licensefile)
sys.exit(1)

configurators = []
for host,(user,password) in creds.items():
for host,(user,password) in list(creds.items()):
configurators.append ( XenServerConfigurator(host,user,password,keyfiledata ) )


for c in configurators: c.start()

for c in configurators:
print c.host + "...",
print(c.host + "...", end=' ')
c.join()
if c.state == 'failed':
if c.retval:
msg = "failed with return code %s: %s%s"%(c.retval,c.stdout,c.stderr)
msg = msg.strip()
print msg
else: print "failed: %s"%c.retval
print(msg)
else: print("failed: %s"%c.retval)
else:
print "done"
print("done")

successes = len( [ a for a in configurators if not a.state == 'failed' ] )
failures = len( [ a for a in configurators if a.state == 'failed' ] )

print "%3s successes"%successes
print "%3s failures"%failures
print("%3s successes"%successes)
print("%3s failures"%failures)
2 changes: 1 addition & 1 deletion client/conf/db.properties.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ db.cloud.testWhileIdle=true
db.cloud.timeBetweenEvictionRunsMillis=40000
db.cloud.minEvictableIdleTimeMillis=240000
db.cloud.poolPreparedStatements=false
db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&sessionVariables=sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'&serverTimezone=UTC
db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&sessionVariables=sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'&serverTimezone=UTC

# CloudStack database SSL settings
db.cloud.useSSL=false
Expand Down
2 changes: 1 addition & 1 deletion cloud-cli/bindir/cloud-tool
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
Expand Down
Loading