Skip to content

Commit 60d0ca5

Browse files
Merge branch 'master' into python2to3vr
2 parents 3195b6f + 0cca854 commit 60d0ca5

File tree

1,691 files changed

+187944
-244024
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,691 files changed

+187944
-244024
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,14 @@ jdk:
2727
python:
2828
- "2.7"
2929

30+
node_js:
31+
- 12
32+
3033
cache:
3134
directories:
3235
- $HOME/.m2
3336
timeout: 500
37+
npm: false
3438

3539
notifications:
3640
email: false

INSTALL.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ Set up Maven (3.6.0):
2828
# echo export PATH=/usr/local/maven/bin:${PATH} >> ~/.bashrc # or .zshrc or .profile
2929
# source ~/.bashrc
3030

31+
Setup up NodeJS (LTS):
32+
33+
# curl -sL https://rpm.nodesource.com/setup_12.x | sudo bash -
34+
# sudo yum install nodejs
35+
# sudo npm install -g @vue/cli npm-check-updates
36+
3137
Start the MySQL service:
3238

3339
$ service mysqld start
@@ -130,7 +136,7 @@ To create rpms, install the following extra packages:
130136

131137
# yum -y install rpm-build
132138
# yum -y install ws-commons-util
133-
# yum -y instal gcc
139+
# yum -y install gcc
134140
# yum -y install glibc-devel
135141
# yum -y install MySQL-python
136142

PULL_REQUEST_TEMPLATE.md

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
## Description
2-
<!--- Describe your changes in detail -->
1+
### Description
2+
3+
This PR...
4+
<!--- Describe your changes in DETAIL - And how has behaviour functionally changed. -->
35

46
<!-- For new features, provide link to FS, dev ML discussion etc. -->
57
<!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. -->
@@ -8,17 +10,39 @@
810
<!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
911
<!-- Fixes: # -->
1012

11-
## Types of changes
12-
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
13+
<!--- ********************************************************************************* -->
14+
<!--- NOTE: AUTOMATATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. -->
15+
<!--- PLEASE PUT AN 'X' in only **ONE** box -->
16+
<!--- ********************************************************************************* -->
17+
18+
### Types of changes
19+
1320
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
1421
- [ ] New feature (non-breaking change which adds functionality)
1522
- [ ] Bug fix (non-breaking change which fixes an issue)
1623
- [ ] Enhancement (improves an existing feature and functionality)
1724
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
1825

19-
## Screenshots (if appropriate):
26+
### Feature/Enhancement Scale or Bug Severity
27+
28+
#### Feature/Enhancement Scale
29+
30+
- [ ] Major
31+
- [ ] Minor
32+
33+
#### Bug Severity
34+
35+
- [ ] BLOCKER
36+
- [ ] Critical
37+
- [ ] Major
38+
- [ ] Minor
39+
- [ ] Trivial
40+
41+
42+
### Screenshots (if appropriate):
43+
2044

21-
## How Has This Been Tested?
45+
### How Has This Been Tested?
2246
<!-- Please describe in detail how you tested your changes. -->
2347
<!-- Include details of your testing environment, and the tests you ran to -->
2448
<!-- see how your change affects other areas of the code, etc. -->

agent/bindir/cloud-guest-tool.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
# Licensed to the Apache Software Foundation (ASF) under one
33
# or more contributor license agreements. See the NOTICE file
44
# distributed with this work for additional information
@@ -78,7 +78,7 @@ class GuestCommand:
7878
info['network'] = 'guest-network-get-interfaces'
7979

8080
result = dict()
81-
for key, cmd in info.items():
81+
for key, cmd in list(info.items()):
8282
result[key] = self.virt.agent_command(self.dom, cmd)
8383

8484
return result, 0

agent/bindir/cloud-setup-agent.in

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/python3
22
# Licensed to the Apache Software Foundation (ASF) under one
33
# or more contributor license agreements. See the NOTICE file
44
# distributed with this work for additional information
@@ -31,56 +31,56 @@ from cloudutils.serviceConfig import configureLibvirtConfig
3131
from optparse import OptionParser
3232

3333
def getUserInputs():
34-
print "Welcome to the CloudStack Agent Setup:"
34+
print("Welcome to the CloudStack Agent Setup:")
3535

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

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

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

5151
if zoneToken == "":
5252
zoneToken = oldToken
5353

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

5757
if podId == "":
5858
podId = oldToken
5959

6060
oldCluster = cfo.getEntry("cluster")
61-
clusterId = raw_input("Please input the Cluster Id:[%s]"%oldCluster)
61+
clusterId = input("Please input the Cluster Id:[%s]"%oldCluster)
6262
if clusterId == "":
6363
clusterId = oldCluster
6464

6565
oldHypervisor = cfo.getEntry("hypervisor")
6666
if oldHypervisor == "":
6767
oldHypervisor = "kvm"
6868

69-
hypervisor = raw_input("Please input the Hypervisor type kvm/lxc:[%s]"%oldHypervisor)
69+
hypervisor = input("Please input the Hypervisor type kvm/lxc:[%s]"%oldHypervisor)
7070
if hypervisor == "":
7171
hypervisor = oldHypervisor
7272

7373
try:
7474
defaultNic = networkConfig.getDefaultNetwork()
7575
except:
76-
print "Failed to get default route. Please configure your network to have a default route"
76+
print("Failed to get default route. Please configure your network to have a default route")
7777
exit(1)
7878

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

116116
if not options.auto and options.secure:
117117
configureLibvirtConfig(True)
118-
print "Libvirtd with TLS configured"
118+
print("Libvirtd with TLS configured")
119119
sys.exit(0)
120120

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

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

150150
glbEnv.secure = options.secure
151151

152-
print "Starting to configure your system:"
152+
print("Starting to configure your system:")
153153
syscfg = sysConfigFactory.getSysConfigFactory(glbEnv)
154154
try:
155155
syscfg.config()
156-
print "CloudStack Agent setup is done!"
157-
except (CloudRuntimeException,CloudInternalException), e:
158-
print e
159-
print "Try to restore your system:"
156+
print("CloudStack Agent setup is done!")
157+
except (CloudRuntimeException,CloudInternalException) as e:
158+
print(e)
159+
print("Try to restore your system:")
160160
try:
161161
syscfg.restore()
162162
except:

agent/bindir/cloudstack-agent-upgrade.in

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/python3
22
# Licensed to the Apache Software Foundation (ASF) under one
33
# or more contributor license agreements. See the NOTICE file
44
# distributed with this work for additional information
55
# regarding copyright ownership. The ASF licenses this file
66
# to you under the Apache License, Version 2.0 (the
77
# "License"); you may not use this file except in compliance
88
# with the License. You may obtain a copy of the License at
9-
#
9+
#
1010
# http://www.apache.org/licenses/LICENSE-2.0
11-
#
11+
#
1212
# Unless required by applicable law or agreed to in writing,
1313
# software distributed under the License is distributed on an
1414
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -32,7 +32,7 @@ def upgradeBridgeName(brName, enslavedDev):
3232
print("find physical device %s"%phyDev)
3333
newBrName = "br" + phyDev + "-" + vlanId
3434
print("new bridge name %s"%newBrName)
35-
bash("ip link set %s down"%brName)
35+
bash("ip link set %s down"%brName)
3636
bash("ip link set %s name %s"%(brName, newBrName))
3737
bash("ip link set %s up" %newBrName)
3838
cmd = "iptables-save | grep FORWARD | grep -w " + brName
@@ -47,16 +47,16 @@ def upgradeBridgeName(brName, enslavedDev):
4747
except:
4848
logging.exception("Ignoring failure to update rules for rule " + rule + " on bridge " + brName)
4949
if __name__ == '__main__':
50-
netlib = networkConfig()
50+
netlib = networkConfig()
5151
bridges = netlib.listNetworks()
52-
bridges = filter(isOldStyleBridge, bridges)
52+
bridges = list(filter(isOldStyleBridge, bridges))
5353
for br in bridges:
5454
enslavedDev = netlib.getEnslavedDev(br, 1)
5555
if enslavedDev is not None:
5656
upgradeBridgeName(br, enslavedDev)
57-
57+
5858
bridges = netlib.listNetworks()
59-
bridges = filter(isOldStyleBridge, bridges)
59+
bridges = list(filter(isOldStyleBridge, bridges))
6060
if len(bridges) > 0:
6161
print("Warning: upgrade is not finished, still some bridges have the old style name:" + str(bridges))
6262
else:

agent/bindir/libvirtqemuhook.in

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/python3
22
# Licensed to the Apache Software Foundation (ASF) under one
33
# or more contributor license agreements. See the NOTICE file
44
# distributed with this work for additional information
@@ -32,7 +32,7 @@ logging.basicConfig(filename='/var/log/libvirt/qemu-hook.log',
3232
logger = logging.getLogger('qemu-hook')
3333

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

@@ -128,9 +128,8 @@ def terminateProcess(process, scriptName):
128128

129129

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

135134

136135
def substringAfter(s, delimiter):

agent/bindir/rolling-maintenance.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/python3
22
# Licensed to the Apache Software Foundation (ASF) under one
33
# or more contributor license agreements. See the NOTICE file
44
# distributed with this work for additional information
@@ -43,7 +43,7 @@ def execute_script(stage, script, payload, timeout):
4343

4444
success = True if exitStatus == 0 or exitStatus == AVOID_MAINTENANCE_EXIT_STATUS else False
4545
avoid_maintenance = True if exitStatus == AVOID_MAINTENANCE_EXIT_STATUS else False
46-
return {"success": success, "message": stdout.strip(), "avoidmaintenance": avoid_maintenance}
46+
return {"success": success, "message": stdout.decode('utf-8').strip(), "avoidmaintenance": avoid_maintenance}
4747
except Exception as e:
4848
logger.error("Error in stage %s: %s" % (script, e))
4949
sys.exit(1)

agent/conf/agent.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,3 +258,8 @@ hypervisor.type=kvm
258258
# timer.
259259
# For all actions refer to the libvirt documentation.
260260
# Recommended values are: none, reset and poweroff.
261+
#
262+
iscsi.session.cleanup.enabled=false
263+
# Automatically clean up iscsi sessions not attached to any VM.
264+
# Should be enabled for users using managed storage for example solidfire.
265+
# Should be disabled for users with unmanaged iscsi connections on their hosts

agent/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<parent>
2525
<groupId>org.apache.cloudstack</groupId>
2626
<artifactId>cloudstack</artifactId>
27-
<version>4.15.0.0-SNAPSHOT</version>
27+
<version>4.16.0.0-SNAPSHOT</version>
2828
</parent>
2929
<dependencies>
3030
<dependency>

0 commit comments

Comments
 (0)