Browse Source

Replace usage of netloc filters to urlsplit

Remove the references to netorigin and netloc_no_port as they will
be taken out from openstack-ansible-plugins

Now using ansible 2.4's urlsplit filter as a replacement.

Change-Id: I94302ced3e5d6faa4d8748590f323e89d9b7280c
Related-Bug: #1820830
Georgina Shippey 1 month ago
parent
commit
dcd9469411
3 changed files with 7 additions and 7 deletions
  1. 2
    2
      tasks/repo_build_prepare.yml
  2. 4
    4
      tasks/repo_build_wheels.yml
  3. 1
    1
      tests/test-repo-build.yml

+ 2
- 2
tasks/repo_build_prepare.yml View File

@@ -129,7 +129,7 @@
129 129
         virtualenv_site_packages: "no"
130 130
         extra_args: >-
131 131
           --index-url {{ repo_build_pip_default_index }}
132
-          --trusted-host {{ repo_build_pip_default_index | netloc_no_port }}
132
+          --trusted-host {{ repo_build_pip_default_index | urlsplit('hostname') }}
133 133
           --constraint {{ repo_build_release_path }}/requirements_constraints.txt
134 134
           {{ pip_install_options | default('') }}
135 135
       register: install_packages
@@ -145,7 +145,7 @@
145 145
         virtualenv_site_packages: "no"
146 146
         extra_args: >-
147 147
           --index-url {{ repo_build_pip_default_index }}
148
-          --trusted-host {{ repo_build_pip_default_index | netloc_no_port }}
148
+          --trusted-host {{ repo_build_pip_default_index | urlsplit('hostname') }}
149 149
           --constraint {{ repo_build_release_path }}/requirements_constraints.txt
150 150
           {{ pip_install_options | default('') }}
151 151
       register: install_packages

+ 4
- 4
tasks/repo_build_wheels.yml View File

@@ -47,10 +47,10 @@
47 47
     --no-binary :all:
48 48
     --constraint {{ repo_build_release_path }}/requirements_constraints.txt
49 49
     --index-url {{ repo_build_pip_default_index }}
50
-    --trusted-host {{ repo_build_pip_default_index | netloc_no_port }}
50
+    --trusted-host {{ repo_build_pip_default_index | urlsplit('hostname') }}
51 51
     {% if repo_build_pip_extra_indexes is defined %}
52 52
     --extra-index-url {{ repo_build_pip_extra_indexes | join(' --extra-index-url ') }}
53
-    --trusted-host {{ repo_build_pip_extra_indexes | map('netloc_no_port') | join(' --trusted-host ') }}
53
+    --trusted-host {{ repo_build_pip_extra_indexes | map(urlsplit('hostname')) | join(' --trusted-host ') }}
54 54
     {% endif %}
55 55
     --requirement {{ repo_build_release_path }}/requirements.txt
56 56
     {{ pip_install_options }}
@@ -72,10 +72,10 @@
72 72
     --no-binary {{ repo_build_pip_no_binary | join(' --no-binary ') }}
73 73
     {% endif %}
74 74
     --index-url {{ repo_build_pip_default_index }}
75
-    --trusted-host {{ repo_build_pip_default_index | netloc_no_port }}
75
+    --trusted-host {{ repo_build_pip_default_index | urlsplit('hostname') }}
76 76
     {% if repo_build_pip_extra_indexes is defined %}
77 77
     --extra-index-url {{ repo_build_pip_extra_indexes | join(' --extra-index-url ') }}
78
-    --trusted-host {{ repo_build_pip_extra_indexes | map('netloc_no_port') | join(' --trusted-host ') }}
78
+    --trusted-host {{ repo_build_pip_extra_indexes | map(urlsplit('hostname')) | join(' --trusted-host ') }}
79 79
     {% endif %}
80 80
     --build {{ repo_build_dir }}
81 81
     --requirement {{ repo_build_release_path }}/requirements.txt

+ 1
- 1
tests/test-repo-build.yml View File

@@ -52,7 +52,7 @@
52 52
 
53 53
     - name: Set Ubuntu Cloud Archive repo URL based on discovered information
54 54
       set_fact:
55
-        uca_apt_repo_url: "{{ ubuntu_repo_url.stdout | netorigin }}/ubuntu-cloud-archive"
55
+        uca_apt_repo_url: "{{ ubuntu_repo_url.stdout | urlsplit('scheme') ~ '://' ~ urlsplit('netloc') }}/ubuntu-cloud-archive"
56 56
       when:
57 57
         - ansible_pkg_mgr == 'apt'
58 58
         - nodepool.stat.exists | bool

Loading…
Cancel
Save