Skip to content

Commit 5f59a02

Browse files
authored
Merge branch 'main' into add-uuid-ldap-conf
2 parents 5d043c3 + ec533cd commit 5f59a02

File tree

247 files changed

+5206
-2298
lines changed

Some content is hidden

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

247 files changed

+5206
-2298
lines changed

.asf.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ github:
6363
protected_branches: ~
6464

6565
notifications:
66-
67-
66+
67+
6868
pullrequests: [email protected]
69-
discussions: [email protected]
69+
discussions: [email protected]

.github/linters/.yamllint.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
---
18+
extends: relaxed
19+
20+
rules:
21+
line-length:
22+
max: 400 # Very forgiving for GitHub Actions and infrastructure files
23+
indentation: disable # Disable indentation checking for existing files
24+
comments: disable # Disable comment formatting checks
25+
brackets: disable # Disable bracket spacing checks
26+
colons:
27+
max-spaces-after: -1 # Allow any number of spaces after colon
28+
max-spaces-before: 0
29+
document-start: disable # Many files don't have ---
30+
truthy:
31+
allowed-values: ['true', 'false', 'on', 'off', 'yes', 'no']

.github/linters/codespell.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,15 +183,12 @@ encryted
183183
enebled
184184
enmpty
185185
entires
186-
enviornment
187186
environmnet
188187
equivalant
189188
erro
190189
erronous
191190
everthing
192191
everytime
193-
excetion
194-
excption
195192
excute
196193
execept
197194
execption
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: CodeQL Analysis
19+
on:
20+
push:
21+
branches: [main]
22+
pull_request:
23+
branches: [main]
24+
permissions:
25+
actions: read
26+
contents: read
27+
security-events: write
28+
jobs:
29+
codeql:
30+
name: CodeQL
31+
runs-on: ubuntu-latest
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: ["actions"]
36+
steps:
37+
- name: Checkout repository
38+
uses: actions/checkout@v4
39+
- name: Initialize CodeQL
40+
uses: github/codeql-action/init@v3
41+
with:
42+
languages: ${{ matrix.language }}
43+
- name: Autobuild
44+
uses: github/codeql-action/autobuild@v3
45+
- name: Perform CodeQL Analysis
46+
uses: github/codeql-action/analyze@v3
47+
with:
48+
category: "Security"

.pre-commit-config.yaml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ repos:
3838
- id: check-case-conflict
3939
#- id: check-executables-have-shebangs
4040
- id: check-merge-conflict
41+
- id: check-shebang-scripts-are-executable
42+
files: \.sh$
4143
- id: check-symlinks
4244
- id: check-vcs-permalinks
4345
#- id: check-yaml
@@ -67,7 +69,7 @@ repos:
6769
- id: mixed-line-ending
6870
exclude: \.cs$
6971
- id: trailing-whitespace
70-
files: \.(bat|cfg|cs|css|gitignore|header|in|install|java|md|properties|py|rb|sh|sql|txt|vue|xml|xsl|yaml|yml)$
72+
files: \.(bat|cfg|cs|css|gitignore|header|in|install|java|md|properties|py|rb|rc|sh|sql|te|template|txt|ucls|vue|xml|xsl|yaml|yml)$|^cloud-cli/bindir/cloud-tool$|^debian/changelog$
7173
args: [--markdown-linebreak-ext=md]
7274
exclude: ^services/console-proxy/rdpconsole/src/test/doc/freerdp-debug-log\.txt$
7375
- repo: https://github.com/codespell-project/codespell
@@ -83,17 +85,6 @@ repos:
8385
hooks:
8486
- id: flake8
8587
args: [--config, .github/linters/.flake8]
86-
exclude: >
87-
(?x)
88-
^agent/bindir/cloud-setup-agent\.in$|
89-
^client/bindir/cloud-update-xenserver-licenses\.in$|
90-
^cloud-cli/bindir/cloud-tool$|
91-
^python/bindir/cloud-grab-dependent-library-versions$|
92-
^python/bindir/cloud-setup-baremetal$|
93-
^scripts/vm/hypervisor/xenserver/storagePlugin$|
94-
^scripts/vm/hypervisor/xenserver/vmopspremium$|
95-
^setup/bindir/cloud-setup-encryption\.in$|
96-
^venv/.*$
9788
- repo: https://github.com/igorshubovych/markdownlint-cli
9889
rev: v0.45.0
9990
hooks:
@@ -103,3 +94,13 @@ repos:
10394
args: [--config=.github/linters/.markdown-lint.yml]
10495
types: [markdown]
10596
files: \.(md|mdown|markdown)$
97+
- repo: https://github.com/adrienverge/yamllint
98+
rev: v1.37.1
99+
hooks:
100+
- id: yamllint
101+
name: run yamllint
102+
description: check YAML files with yamllint
103+
args: [--config-file=.github/linters/.yamllint.yml]
104+
types: [yaml]
105+
files: \.ya?ml$
106+
exclude: ^.*k8s-.*\.ya?ml$

CHANGES.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,12 +644,12 @@ Bug ID | Description
644644
Version 4.2.1
645645
-------------
646646

647-
Release notes contain the list of [bug fixes](http://cloudstack.apache.org/docs/en-US/Apache_CloudStack/4.2.1/html/Release_Notes/version-4.2.html#issues-fixed-4.2.1)
647+
Release notes contain the list of [bug fixes](https://cloudstack.apache.org/docs/en-US/Apache_CloudStack/4.2.1/html/Release_Notes/version-4.2.html#issues-fixed-4.2.1)
648648

649649
Version 4.2.0
650650
-------------
651651
Released on October 1 2013.
652-
Release notes contain the list of [bug fixes](http://cloudstack.apache.org/docs/en-US/Apache_CloudStack/4.2.0/html/Release_Notes/index.html)
652+
Release notes contain the list of [bug fixes](https://cloudstack.apache.org/docs/en-US/Apache_CloudStack/4.2.0/html/Release_Notes/index.html)
653653

654654
Version 4.1.0
655655
-------------

INSTALL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Apache CloudStack Installation basics
22

33
This document describes how to develop, build, package and install Apache
4-
CloudStack. For more information please refer to the official [documentation](http://docs.cloudstack.apache.org)
4+
CloudStack. For more information please refer to the official [documentation](https://docs.cloudstack.apache.org)
55
or the developer [wiki](https://cwiki.apache.org/confluence/display/CLOUDSTACK/Home).
66

77
Apache CloudStack developers use various platforms for development, this guide
@@ -41,7 +41,7 @@ Start the MySQL service:
4141

4242
### Using jenv and/or pyenv for Version Management
4343

44-
CloudStack is built using Java and Python. To make selection of these tools versions more consistent and ease installation for developers, optional support for [jenv](http://www.jenv.be/) and [pyenv](https://github.com/yyuu/pyenv) with [virtualenv]|(https://github.com/yyuu/pyenv-virtualenv) is provided. jenv installation instructions are available here and pyenv installation instructions are available here. For users of [oh-my-zsh](http://ohmyz.sh/) there is a pyenv plugin available to trigger configuration of pyenv in a shell session.
44+
CloudStack is built using Java and Python. To make selection of these tools versions more consistent and ease installation for developers, optional support for [jenv](http://www.jenv.be/) and [pyenv](https://github.com/yyuu/pyenv) with [virtualenv]|(https://github.com/yyuu/pyenv-virtualenv) is provided. jenv installation instructions are available here and pyenv installation instructions are available here. For users of [oh-my-zsh](https://ohmyz.sh/) there is a pyenv plugin available to trigger configuration of pyenv in a shell session.
4545

4646
Following installation, execute the following commands to configure jenv and pyenv for use with CloudStack development:
4747

@@ -171,7 +171,7 @@ All the rpm packages will be created in `dist/rpmbuild/RPMS/x86_64` directory.
171171

172172
## Notes
173173

174-
If you will be using Xen as your hypervisor, please download [vhd-util](http://download.cloudstack.org/tools/vhd-util)
174+
If you will be using Xen as your hypervisor, please download [vhd-util](https://download.cloudstack.org/tools/vhd-util)
175175

176176
If management server is installed on RHEL/CentOS, then copy vhd-util into:
177177

PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ This PR...
2222
- [ ] Bug fix (non-breaking change which fixes an issue)
2323
- [ ] Enhancement (improves an existing feature and functionality)
2424
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
25-
- [ ] build/CI
26-
- [ ] test (unit or integration test code)
25+
- [ ] Build/CI
26+
- [ ] Test (unit or integration test code)
2727

2828
### Feature/Enhancement Scale or Bug Severity
2929

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ OVM and LXC containers.
3131
Users can manage their cloud with an easy to use Web interface, command line
3232
tools, and/or a full-featured query based API.
3333

34-
For more information on Apache CloudStack, please visit the [website](http://cloudstack.apache.org)
34+
For more information on Apache CloudStack, please visit the [website](https://cloudstack.apache.org)
3535

3636
## Who Uses CloudStack?
3737

@@ -88,10 +88,10 @@ via GitHub pull requests.
8888
## Getting Involved and Contributing
8989

9090
Interested in helping out with Apache CloudStack? Great! We welcome
91-
participation from anybody willing to work [The Apache Way](http://theapacheway.com) and make a
91+
participation from anybody willing to work [The Apache Way](https://theapacheway.com) and make a
9292
contribution. Note that you do not have to be a developer in order to contribute
9393
to Apache CloudStack. We need folks to help with documentation, translation,
94-
promotion etc. See our contribution [page](http://cloudstack.apache.org/contribute.html).
94+
promotion etc. See our contribution [page](https://cloudstack.apache.org/contribute.html).
9595

9696
If you are a frequent contributors, you can request to be added as collaborators
9797
(see https://cwiki.apache.org/confluence/display/INFRA/Git+-+.asf.yaml+features#Git.asf.yamlfeatures-AssigningexternalcollaboratorswiththetriageroleonGitHub)
@@ -102,7 +102,7 @@ You may do so by sharing your GitHub users ID or raise a GitHub issue.
102102

103103
If you're interested in learning more or participating in the Apache CloudStack
104104
project, the mailing lists are the best way to do that. While the project has
105-
several communications channels, the [mailing lists](http://cloudstack.apache.org/mailing-lists.html) are the most active and the
105+
several communications channels, the [mailing lists](https://cloudstack.apache.org/mailing-lists.html) are the most active and the
106106
official channels for making decisions about the project itself.
107107

108108
Mailing lists:
@@ -122,7 +122,7 @@ released version of CloudStack, please report it to `[email protected]` with
122122
details about the vulnerability, how it might be exploited, and any additional
123123
information that might be useful.
124124

125-
For more details, please visit our security [page](http://cloudstack.apache.org/security.html).
125+
For more details, please visit our security [page](https://cloudstack.apache.org/security.html).
126126

127127
## License
128128

agent/bindir/cloud-setup-agent.in

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,62 +35,70 @@ for pythonpath in (
3535

3636
from cloudutils.cloudException import CloudRuntimeException, CloudInternalException
3737
from cloudutils.utilities import initLoging, bash
38-
from cloudutils.configFileOps import configFileOps
38+
from cloudutils.configFileOps import configFileOps
3939
from cloudutils.globalEnv import globalEnv
4040
from cloudutils.networkConfig import networkConfig
4141
from cloudutils.syscfg import sysConfigFactory
4242
from cloudutils.serviceConfig import configureLibvirtConfig, configure_libvirt_tls
4343

4444
from optparse import OptionParser
4545

46+
4647
def getUserInputs():
4748
print("Welcome to the CloudStack Agent Setup:")
4849

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

52-
mgtSvr = input("Please input the Management Server Hostname/IP-Address:[%s]"%oldMgt)
53+
mgtSvr = input(
54+
"Please input the Management Server Hostname/IP-Address:[%s]" % oldMgt
55+
)
5356
if mgtSvr == "":
5457
mgtSvr = oldMgt
5558
try:
5659
socket.getaddrinfo(mgtSvr, 443)
5760
except:
58-
print("Failed to resolve %s. Please input a valid hostname or IP-Address."%mgtSvr)
61+
print(
62+
"Failed to resolve %s. Please input a valid hostname or IP-Address."
63+
% mgtSvr
64+
)
5965
exit(1)
6066

6167
oldToken = cfo.getEntry("zone")
62-
zoneToken = input("Please input the Zone Id:[%s]"%oldToken)
68+
zoneToken = input("Please input the Zone Id:[%s]" % oldToken)
6369

6470
if zoneToken == "":
6571
zoneToken = oldToken
6672

6773
oldPod = cfo.getEntry("pod")
68-
podId = input("Please input the Pod Id:[%s]"%oldPod)
74+
podId = input("Please input the Pod Id:[%s]" % oldPod)
6975

7076
if podId == "":
71-
podId = oldToken
77+
podId = oldToken
7278

7379
oldCluster = cfo.getEntry("cluster")
74-
clusterId = input("Please input the Cluster Id:[%s]"%oldCluster)
80+
clusterId = input("Please input the Cluster Id:[%s]" % oldCluster)
7581
if clusterId == "":
7682
clusterId = oldCluster
7783

7884
oldHypervisor = cfo.getEntry("hypervisor")
7985
if oldHypervisor == "":
8086
oldHypervisor = "kvm"
8187

82-
hypervisor = input("Please input the Hypervisor type kvm/lxc:[%s]"%oldHypervisor)
88+
hypervisor = input("Please input the Hypervisor type kvm/lxc:[%s]" % oldHypervisor)
8389
if hypervisor == "":
8490
hypervisor = oldHypervisor
8591

8692
try:
8793
defaultNic = networkConfig.getDefaultNetwork()
8894
except:
89-
print("Failed to get default route. Please configure your network to have a default route")
95+
print(
96+
"Failed to get default route. Please configure your network to have a default route"
97+
)
9098
exit(1)
9199

92100
defNic = defaultNic.name
93-
network = input("Please choose which network used to create VM:[%s]"%defNic)
101+
network = input("Please choose which network used to create VM:[%s]" % defNic)
94102
if network == "":
95103
if defNic == "":
96104
print("You need to specify one of Nic or bridge on your system")
@@ -100,21 +108,32 @@ def getUserInputs():
100108

101109
return [mgtSvr, zoneToken, network, podId, clusterId, hypervisor]
102110

103-
if __name__ == '__main__':
111+
112+
if __name__ == "__main__":
104113
initLoging("@AGENTLOGDIR@/setup.log")
105114
glbEnv = globalEnv()
106115

107116
glbEnv.mode = "Agent"
108117
glbEnv.agentMode = "Agent"
109118
parser = OptionParser()
110119
parser.add_option("-a", action="store_true", dest="auto", help="auto mode")
111-
parser.add_option("-m", "--host", dest="mgt", help="Management server hostname or IP-Address")
120+
parser.add_option(
121+
"-m", "--host", dest="mgt", help="Management server hostname or IP-Address"
122+
)
112123
parser.add_option("-z", "--zone", dest="zone", help="zone id")
113124
parser.add_option("-p", "--pod", dest="pod", help="pod id")
114125
parser.add_option("-c", "--cluster", dest="cluster", help="cluster id")
115-
parser.add_option("-t", "--hypervisor", default="kvm", dest="hypervisor", help="hypervisor type")
126+
parser.add_option(
127+
"-t", "--hypervisor", default="kvm", dest="hypervisor", help="hypervisor type"
128+
)
116129
parser.add_option("-g", "--guid", dest="guid", help="guid")
117-
parser.add_option("-s", action="store_true", default=False, dest="secure", help="Secure and enable TLS for libvirtd")
130+
parser.add_option(
131+
"-s",
132+
action="store_true",
133+
default=False,
134+
dest="secure",
135+
help="Secure and enable TLS for libvirtd",
136+
)
118137
parser.add_option("--pubNic", dest="pubNic", help="Public traffic interface")
119138
parser.add_option("--prvNic", dest="prvNic", help="Private traffic interface")
120139
parser.add_option("--guestNic", dest="guestNic", help="Guest traffic interface")
@@ -140,15 +159,15 @@ if __name__ == '__main__':
140159
glbEnv.pod = userInputs[3]
141160
glbEnv.cluster = userInputs[4]
142161
glbEnv.hypervisor = userInputs[5]
143-
#generate UUID
162+
# generate UUID
144163
glbEnv.uuid = old_config.getEntry("guid")
145164
if glbEnv.uuid == "":
146165
glbEnv.uuid = bash("uuidgen").getStdout()
147166
else:
148167
for para, value in list(options.__dict__.items()):
149168
if value is None:
150-
print("Missing operand:%s"%para)
151-
print("Try %s --help for more information"%sys.argv[0])
169+
print("Missing operand:%s" % para)
170+
print("Try %s --help for more information" % sys.argv[0])
152171
sys.exit(1)
153172

154173
glbEnv.uuid = options.guid
@@ -168,7 +187,7 @@ if __name__ == '__main__':
168187
try:
169188
syscfg.config()
170189
print("CloudStack Agent setup is done!")
171-
except (CloudRuntimeException,CloudInternalException) as e:
190+
except (CloudRuntimeException, CloudInternalException) as e:
172191
print(e)
173192
print("Try to restore your system:")
174193
try:

0 commit comments

Comments
 (0)