Skip to content

Commit 79959d3

Browse files
amolpati30web-flow
authored andcommitted
Add locator support for OpenShift Virtualization (#2327)
(cherry picked from commit 21a03d0)
1 parent 34e43ae commit 79959d3

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

airgun/views/computeresource.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ class LibvirtProviderForm(View):
9595
display_type = Select(id='compute_resource_display_type')
9696
console_passwords = Checkbox(id='compute_resource_set_console_password')
9797

98+
@provider_content.register('OpenShift Virtualization')
99+
class OCPVProviderForm(View):
100+
hostname = TextInput(id='compute_resource_hostname')
101+
api_port = TextInput(id='compute_resource_api_port')
102+
namespace = TextInput(id='compute_resource_namespace')
103+
token = TextInput(id='compute_resource_password')
104+
ca_cert = TextInput(id='compute_resource_ca_cert')
105+
98106
@provider_content.register('RHEL OpenStack Platform')
99107
class OpenStackProviderForm(View):
100108
url = TextInput(id='compute_resource_url')

airgun/views/host.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ class BridgeForm(View):
193193
# Compute resource attributes
194194
network_type = FilteredDropdown(id='_compute_attributes_type')
195195
network = FilteredDropdown(id='_compute_attributes_bridge')
196+
ocpv_network = FilteredDropdown(id='_compute_attributes_network')
197+
cni_provider = FilteredDropdown(id='_compute_attributes_cni_provider')
196198
nic_type = FilteredDropdown(id='_compute_attributes_model')
197199

198200
def after_fill(self, was_change):
@@ -391,6 +393,32 @@ class operating_system(SatTab):
391393
image = FilteredDropdown(id='azure_rm_image_id')
392394
root_password = TextInput(id='host_root_pass')
393395

396+
@provider_content.register('OpenShift Virtualization')
397+
class OCPVResourceForm(View):
398+
@View.nested
399+
class virtual_machine(SatTab):
400+
TAB_NAME = 'Virtual Machine'
401+
cpus = TextInput(id='host_compute_attributes_cpu_cores')
402+
memory = TextInput(id='host_compute_attributes_memory')
403+
startup = Checkbox(id='host_compute_attributes_start')
404+
405+
@View.nested
406+
class storage(SatTab):
407+
TAB_NAME = 'Virtual Machine'
408+
storage_volumes = (
409+
".//fieldset[@id='storage_volumes']/div/div[contains(@class,'removable-item')]"
410+
)
411+
storage_class = FilteredDropdown(locator=storage_volumes)
412+
size = TextInput(locator=f"{storage_volumes}//input[contains(@id, 'capacity')]")
413+
bootable = Checkbox(
414+
locator=f"{storage_volumes}//div[3]//input[contains(@onclick, 'bootableRadio(this)')]"
415+
)
416+
417+
@View.nested
418+
class operating_system(SatTab):
419+
TAB_NAME = 'Operating System'
420+
provision_method = Checkbox(id='host_provision_method_image')
421+
394422
@View.nested
395423
class operating_system(SatTab):
396424
TAB_NAME = 'Operating System'

0 commit comments

Comments
 (0)