Skip to content

Commit 9d27ebf

Browse files
authored
fix tests (#22)
1 parent 518f19b commit 9d27ebf

File tree

7 files changed

+9
-17
lines changed

7 files changed

+9
-17
lines changed

.github/workflows/integration.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- master
7+
pull_request:
78
schedule:
89
- cron: 30 6 * * *
910

.github/workflows/sanity.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ jobs:
2828
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
2929

3030
- name: Run sanity tests
31-
run: ansible-test sanity --docker -v --color --python 3.6
31+
run: ansible-test sanity --docker -v --color

plugins/module_utils/cloudstack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ def get_pod(self, key=None):
378378
pods = self.query_api('listPods', **args)
379379
if pods:
380380
return self._get_by_key(key, pods['pod'][0])
381-
self.module.fail_json(msg="Pod %s not found" % pod_name)
381+
self.module.fail_json(msg="Pod %s not found in zone %s" % (self.module.params.get('pod'), self.get_zone(key='name')))
382382

383383
def get_ip_address(self, key=None):
384384
if self.ip_address:

plugins/modules/cs_storage_pool.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -415,20 +415,6 @@ def get_storage_provider(self, type="primary"):
415415
return provider
416416
self.fail_json(msg="Storage provider %s not found" % provider)
417417

418-
def get_pod(self, key=None):
419-
pod = self.module.params.get('pod')
420-
if not pod:
421-
return None
422-
args = {
423-
'name': pod,
424-
'zoneid': self.get_zone(key='id'),
425-
}
426-
pods = self.query_api('listPods', **args)
427-
if pods:
428-
return self._get_by_key(key, pods['pod'][0])
429-
430-
self.fail_json(msg="Pod %s not found" % self.module.params.get('pod'))
431-
432418
def get_cluster(self, key=None):
433419
cluster = self.module.params.get('cluster')
434420
if not cluster:

plugins/modules/cs_vlan_ip_range.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
description:
7878
- Name of the pod.
7979
type: str
80+
version_added: 1.0.0
8081
state:
8182
description:
8283
- State of the network ip range.
@@ -109,6 +110,7 @@
109110
VLAN range to the Physical Network with a Public traffic type.
110111
type: bool
111112
default: no
113+
version_added: 1.0.0
112114
for_system_vms:
113115
description:
114116
- C(yes) if IP range is set to system vms, C(no) if not

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
cs_cluster:
6464
name: "{{ cs_resource_prefix }}-cluster"
6565
zone: "{{ cs_resource_prefix }}-zone"
66+
pod: "{{ cs_resource_prefix }}-pod"
6667
hypervisor: Simulator
6768
cluster_type: CloudManaged
6869
register: cluster_origin
@@ -77,6 +78,7 @@
7778
cs_cluster:
7879
name: "{{ cs_resource_prefix }}-cluster"
7980
zone: "{{ cs_resource_prefix }}-zone"
81+
pod: "{{ cs_resource_prefix }}-pod"
8082
hypervisor: Simulator
8183
cluster_type: CloudManaged
8284
register: cluster_origin
@@ -95,6 +97,7 @@
9597
cs_cluster:
9698
name: "{{ cs_resource_prefix }}-Cluster"
9799
zone: "{{ cs_resource_prefix }}-Zone"
100+
pod: "{{ cs_resource_prefix }}-pod"
98101
hypervisor: Simulator
99102
cluster_type: CloudManaged
100103
register: cluster

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
assert:
8585
that:
8686
- sp is failed
87-
- "sp.msg == 'Pod DNE not found'"
87+
- "'Pod DNE not found' in sp.msg"
8888

8989
- name: create storage pool in check mode
9090
cs_storage_pool:

0 commit comments

Comments
 (0)