Skip to content

Commit

Permalink
Add retries to libvirt pool refresh (in case of concurrent background…
Browse files Browse the repository at this point in the history
… operations)

Jenkinsfile_testsuite: Set sandbox true for active choice parameter
  • Loading branch information
Dougal Seeley committed Dec 31, 2022
1 parent 9039cac commit 3ff1604
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions create/tasks/create_libvirt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
uri: 'qemu+ssh://{{ cluster_vars.libvirt.username }}@{{ cluster_vars.libvirt.hypervisor }}/system?keyfile=id_rsa__libvirt_svc&no_verify=1'
name: default
command: refresh
register: r__virt_pool
until: r__virt_pool is success
retries: 10
when: "redeploy_scheme is defined and redeploy_scheme == '_scheme_rmvm_keepdisk_rollback'"


Expand Down
2 changes: 1 addition & 1 deletion jenkinsfiles/Jenkinsfile_testsuite
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ properties([
extendedChoice(name: 'SCALEUPDOWN', type: 'PT_MULTI_SELECT', value: 'noscale,scaleup,scaledown', defaultValue: 'noscale', description: 'Specify whether to test scaling up and/or down.', visibleItemCount: 3),
extendedChoice(name: 'IMAGE_TESTED', type: 'PT_MULTI_SELECT', value: '_ubuntu2204image,_ubuntu2004image,_ubuntu1804image,_centos7image,_alma8image', defaultValue: '_ubuntu2204image', descriptionPropertyValue: 'Ubuntu 22.04, Ubuntu 20.04, Ubuntu 18.04, CentOS 7, AlmaLinux 8', description: 'Specify which image(s) to test', visibleItemCount: 4),
// extendedChoice(name: 'ANSIBLE_VERSION_X', type: 'PT_MULTI_SELECT', bindings: '', description: 'Version of Ansible to use for testing', groovyClasspath: '', groovyScript: '''import groovy.json.JsonSlurper; def ansibleReleases= ["curl", "-s", "-H", "Accept: application/json", "-H", "Content-type: application/json", "GET", "https://pypi.org/pypi/ansible/json"].execute().text; def list = new JsonSlurper().parseText(ansibleReleases); return list.releases.keySet().collect{(it=~/^(?![1-4]\\.|5\\.[0,2-5]|5\\.[1]\\.).*?\\.(?:\\d+)$/).findAll().join()}.findAll().collectEntries{[(it=~/\\d+|\\D+/).findAll().collect{it.padLeft(3,\'0\')}.join(), it]}.sort().values().collect().reverse();''', multiSelectDelimiter: ',', quoteValue: false, saveJSONParameterToFile: false, visibleItemCount: 5),
[name: 'ANSIBLE_VERSION', $class: 'ChoiceParameter', choiceType: 'PT_MULTI_SELECT', description: 'Version of Ansible to use for testing.', randomName: 'choice-parameter-264936764694694', script: [$class: 'GroovyScript', fallbackScript: [classpath: [], oldScript: '', sandbox: false, script: 'return([])'], script: [classpath: [], oldScript: '', sandbox: false, script: 'import groovy.json.JsonSlurper; def ansibleReleases= ["curl", "-s", "-H", "Accept: application/json", "-H", "Content-type: application/json", "GET", "https://pypi.org/pypi/ansible/json"].execute().text; def list = new JsonSlurper().parseText(ansibleReleases); return list.releases.keySet().collect{(it=~/^(?![1-4]\\.|5\\.[0,2-5]|5\\.[1]\\.).*?\\.(?:\\d+)$/).findAll().join()}.findAll().collectEntries{[(it=~/\\d+|\\D+/).findAll().collect{it.padLeft(3,\'0\')}.join(), it]}.sort().values().collect().reverse().withIndex().collect {elem, idx -> idx==0 ? elem + ":selected" : elem};']]],
[name: 'ANSIBLE_VERSION', $class: 'ChoiceParameter', choiceType: 'PT_MULTI_SELECT', description: 'Version of Ansible to use for testing.', randomName: 'choice-parameter-264936764694694', script: [$class: 'GroovyScript', fallbackScript: [classpath: [], oldScript: '', sandbox: true, script: 'return([])'], script: [classpath: [], oldScript: '', sandbox: true, script: 'import groovy.json.JsonSlurper; def ansibleReleases= ["curl", "-s", "-H", "Accept: application/json", "-H", "Content-type: application/json", "GET", "https://pypi.org/pypi/ansible/json"].execute().text; def list = new JsonSlurper().parseText(ansibleReleases); return list.releases.keySet().collect{(it=~/^(?![1-4]\\.|5\\.[0,2-5]|5\\.[1]\\.).*?\\.(?:\\d+)$/).findAll().join()}.findAll().collectEntries{[(it=~/\\d+|\\D+/).findAll().collect{it.padLeft(3,\'0\')}.join(), it]}.sort().values().collect().reverse().withIndex().collect {elem, idx -> idx==0 ? elem + ":selected" : elem};']]],
])
])

Expand Down

0 comments on commit 3ff1604

Please sign in to comment.