Skip to content

Commit 17970cd

Browse files
authored
fix: bump machines create timeout (#48)
1 parent 2c06024 commit 17970cd

9 files changed

Lines changed: 13 additions & 11 deletions

File tree

.github/workflows/ci-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
env -C "$GITHUB_WORKSPACE/$REPO_DIR" -- tox -e sanity
3131
3232
units-test:
33-
runs-on: ubuntu-latest
33+
runs-on: ubuntu-22.04
3434
steps:
3535
- name: Checkout
3636
uses: actions/checkout@v3

plugins/module_utils/form.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ def get_mulipart(data):
3636
content += f'Content-Disposition: form-data; name="{k}"{rn}{rn}'
3737
content += str(v)
3838
content += rn
39-
content += f"--{ boundary }--"
39+
content += f"--{boundary}--"
4040
return boundary, content.encode("utf-8")

plugins/module_utils/machine.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,9 @@ def commission(self, client):
374374

375375
@classmethod
376376
def create(cls, client, payload):
377-
maas_dict = client.post("/api/2.0/machines/", data=payload).json
377+
maas_dict = client.post(
378+
"/api/2.0/machines/", data=payload, timeout=60
379+
).json
378380
return cls.from_maas(maas_dict)
379381

380382
def update(self, client, payload):

plugins/modules/dns_record.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def get_match_or_fail(items, key, value, attribute_name):
107107

108108
available_items = ", ".join(x[key] for x in items)
109109
raise errors.MaasError(
110-
f"Can not find matching { attribute_name }. Options are [{ available_items }]"
110+
f"Can not find matching {attribute_name}. Options are [{available_items}]"
111111
)
112112

113113

plugins/modules/subnet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def get_match_or_fail(items, key, value, attribute_name):
147147

148148
available_items = ", ".join(x[key] for x in items)
149149
raise errors.MaasError(
150-
f"Can not find matching { attribute_name }. Options are [{ available_items }]"
150+
f"Can not find matching {attribute_name}. Options are [{available_items}]"
151151
)
152152

153153

plugins/modules/subnet_ip_range.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def ensure_present(module, client: Client):
128128
if not subnet:
129129
available_subnets = ", ".join(x["name"] for x in subnets)
130130
raise errors.MaasError(
131-
f"Can not find matching subnet. Options are [{ available_subnets }]"
131+
f"Can not find matching subnet. Options are [{available_subnets}]"
132132
)
133133

134134
compound_key = {

tests/integration/integration_config.yml.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ test_domain: ...
55
token_key: ...
66
token_secret: ...
77
customer_key: ...
8+
test_distro_series: ...
89
test_existing_vm_host: ...
910
test_lxd_host:
1011
hostname: ...

tests/integration/targets/instance/tasks/main.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
vars:
88
vm_host: "{% if test_existing_vm_host is defined %}{{ test_existing_vm_host }}{% else %}{{ test_lxd_host.hostname }}{% endif %}"
99

10-
1110
block:
1211
- name: Delete machine
1312
maas.maas.instance: &delete
@@ -48,7 +47,7 @@
4847
- machine.record.memory == 8192
4948
- machine.record.cores == 4
5049
- machine.record.osystem == "ubuntu"
51-
- machine.record.distro_series == "focal"
50+
- machine.record.distro_series == "{{ test_distro_series }}"
5251
- machine.record.status == "Deployed"
5352

5453
- name: Deploy machine - idempotence
@@ -62,7 +61,7 @@
6261
- machine.record.memory == 8192
6362
- machine.record.cores == 4
6463
- machine.record.osystem == "ubuntu"
65-
- machine.record.distro_series == "focal"
64+
- machine.record.distro_series == "{{ test_distro_series }}"
6665
- machine.record.status == "Deployed"
6766

6867
- name: Release machine
@@ -147,7 +146,7 @@
147146
# - machine.record.memory == 8192
148147
# - machine.record.cores == 4
149148
# - machine.record.osystem == "ubuntu"
150-
# - machine.record.distro_series == "focal"
149+
# - machine.record.distro_series == "{{ test_distro_series }}"
151150
# - machine.record.status == "Deployed"
152151

153152
# - name: Release machine (ephemeral machine is deleted)

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ commands =
9393
black --check {[base]lint_paths}
9494
flake8 {[base]lint_paths}
9595
ansible-lint
96-
ansible-test sanity --local
96+
ansible-test sanity --local --skip-test shebang
9797

9898
[testenv:integration]
9999
passenv =

0 commit comments

Comments
 (0)