Skip to content

Commit b009fcc

Browse files
authored
Merge pull request #2105 from vamahaja/maas-integration
[Lib] Add MAAS (Metal-as-a-Service) provisioner
2 parents f02d889 + 548b12f commit b009fcc

14 files changed

+786
-2
lines changed

docs/siteconfig.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,14 @@ Here is a sample configuration with many of the options set and documented::
258258
endpoint: http://head.ses.suse.de:5000/
259259
machine_types: ['type1', 'type2', 'type3']
260260

261+
# Settings for MaaS (https://maas.io)
262+
maas:
263+
api_url: http://maas.example.com:5240/MAAS/api/2.0/
264+
api_key: <consumer_key>:<consumer_token>:<secret>
265+
machine_types: ['typeA', 'typeB']
266+
timeout: 900
267+
user_data: teuthology/maas/user_data/maas-{os_type}-{os_version}-user-data.txt
268+
261269
# Do not allow more than that many jobs in a single run by default.
262270
# To disable this check use 0.
263271
job_threshold: 500

requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,11 @@ zope-interface==6.1
203203
openstacksdk==4.5.0
204204
# via teuthology (pyproject.toml)
205205
python-openstackclient>=6.0.0
206+
# via teuthology (pyproject.toml)
207+
oauthlib==3.3.1
208+
# via teuthology (pyproject.toml)
209+
requests-oauthlib==2.0.0
210+
# via teuthology (pyproject.toml)
206211
# The following packages are considered to be unsafe in a requirements file:
207212
# pip
208213
# setuptools

setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ install_requires =
4545
ndg-httpsclient
4646
netaddr
4747
openstacksdk # teuthology-openstack dependencies
48+
oauthlib
49+
requests-oauthlib
4850
paramiko
4951
pexpect
5052
pip-tools

teuthology/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@
6060
# We also don't need the "Converted retries value" messages
6161
logging.getLogger('urllib3.util.retry').setLevel(
6262
logging.WARN)
63+
# Avoid verbose logging for requests_oauthlib also
64+
logging.getLogger('requests_oauthlib').setLevel(
65+
logging.WARN)
66+
# Suppresses the underlying oauthlib library
67+
logging.getLogger('oauthlib.oauth1').setLevel(logging.WARN)
6368

6469
logging.basicConfig(
6570
level=logging.INFO,

teuthology/lock/ops.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,9 @@ def stop_node(name: str, status: Union[dict, None]):
503503
elif status['machine_type'] in provision.pelagos.get_types():
504504
provision.pelagos.park_node(name)
505505
return
506+
elif status['machine_type'] in provision.maas.get_types():
507+
provision.maas.MAAS(name).release()
508+
return
506509
elif remote_.is_container:
507510
remote_.run(
508511
args=['sudo', '/testnode_stop.sh'],
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#cloud-config
2+
disable_root: false
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#cloud-config
2+
disable_root: false
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#cloud-config
2+
disable_root: false
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#cloud-config
2+
disable_root: false
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#cloud-config
2+
disable_root: false

0 commit comments

Comments
 (0)