Skip to content

Commit

Permalink
Merge pull request #1570 from grycap/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
micafer authored Jun 6, 2024
2 parents 646ab8f + e370426 commit 778bfb9
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 11 deletions.
4 changes: 2 additions & 2 deletions IM/ConfManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ def wait_vm_running(self, vm, timeout):
Arguments:
- vm(:py:class:`IM.VirtualMachine`): VM to be running.
- timeout(int): Max time to wait the VM to be running.
- timeout(int): Max time to wait for the VM to be running.
Returns: True if all the VMs are running or false otherwise
"""
delay = Config.CHECK_CTXT_PROCESS_INTERVAL
Expand Down Expand Up @@ -1132,7 +1132,7 @@ def wait_vm_ssh_acccess(self, vm, timeout):
Arguments:
- vm(:py:class:`IM.VirtualMachine`): VM to check.
- timeout(int): Max time to wait the VM to be to have the SSH port opened.
- timeout(int): Max time to wait for the VM to be to have the SSH port opened.
Returns: True if the VM have the SSH port open or false otherwise
"""
delay = 10
Expand Down
2 changes: 1 addition & 1 deletion IM/connectors/OpenNebula.py
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ def alterVM(self, vm, radl, auth_data):
if not success:
return (False, info)

# TODO: wait the VM to be running
# TODO: wait for the VM to be running
time.sleep(5)

success, info = self.attach_new_disks(vm, system, session_id)
Expand Down
20 changes: 16 additions & 4 deletions IM/connectors/OpenStack.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,11 +880,23 @@ def get_ost_network_info(driver, pool_names):
# let's assume that is not public
ost_net.extra['is_public'] = False

# set the networks with the default work in its name first
res = ([ost_net for ost_net in ost_nets if "default" in ost_net.name] +
[ost_net for ost_net in ost_nets if "default" not in ost_net.name])
# set first the networks with the default word in its name
# or with the "is_default" extra field set to True
# or with a tag "default"
first = []
last = []
for ost_net in ost_nets:
if (
"default" in ost_net.name or
"is_default" in ost_net.extra and ost_net.extra['is_default'] or
"tags" in ost_net.extra and "default" in ost_net.extra['tags'] or
"description" in ost_net.extra and "default" in ost_net.extra['description']
):
first.append(ost_net)
else:
last.append(ost_net)

return get_subnets, res
return get_subnets, first + last

@staticmethod
def map_networks(radl, ost_nets):
Expand Down
2 changes: 1 addition & 1 deletion contextualization/basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
ignore_errors: yes
changed_when: false

- name: Wait the VM to boot
- name: Wait for the VM to boot
raw: systemctl is-system-running --wait
ignore_errors: yes
changed_when: false
Expand Down
2 changes: 1 addition & 1 deletion contextualization/conf-ansible.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
ignore_errors: yes
changed_when: false

- name: Wait the VM to boot
- name: Wait for the VM to boot
raw: systemctl is-system-running --wait
ignore_errors: yes
changed_when: false
Expand Down
2 changes: 1 addition & 1 deletion doc/source/xmlrpc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ This is the list of method names:

Create and configure an infrastructure with the requirements specified in
the RADL document passed as string. Return the ID associated to the created
infrastructure. If ``async`` is set to ``True`` the call will not wait the VMs
infrastructure. If ``async`` is set to ``True`` the call will not wait forthe VMs
to be created.

``GetInfrastructureInfo``
Expand Down
2 changes: 1 addition & 1 deletion doc/swagger_api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ paths:
in: query
description: >-
The async parameter is optional and is a flag to specify if the call
will not wait the VMs to be created.
will not wait for the VMs to be created.
required: false
schema:
type: string
Expand Down

0 comments on commit 778bfb9

Please sign in to comment.