cloudpub 1.3.3__tar.gz → 1.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. {cloudpub-1.3.3/cloudpub.egg-info → cloudpub-1.4.0}/PKG-INFO +1 -1
  2. {cloudpub-1.3.3 → cloudpub-1.4.0}/cloudpub/ms_azure/service.py +1 -1
  3. {cloudpub-1.3.3 → cloudpub-1.4.0}/cloudpub/ms_azure/utils.py +26 -17
  4. {cloudpub-1.3.3 → cloudpub-1.4.0/cloudpub.egg-info}/PKG-INFO +1 -1
  5. {cloudpub-1.3.3 → cloudpub-1.4.0}/setup.py +1 -1
  6. {cloudpub-1.3.3 → cloudpub-1.4.0}/LICENSE +0 -0
  7. {cloudpub-1.3.3 → cloudpub-1.4.0}/MANIFEST.in +0 -0
  8. {cloudpub-1.3.3 → cloudpub-1.4.0}/README.md +0 -0
  9. {cloudpub-1.3.3 → cloudpub-1.4.0}/cloudpub/__init__.py +0 -0
  10. {cloudpub-1.3.3 → cloudpub-1.4.0}/cloudpub/aws/__init__.py +0 -0
  11. {cloudpub-1.3.3 → cloudpub-1.4.0}/cloudpub/aws/service.py +0 -0
  12. {cloudpub-1.3.3 → cloudpub-1.4.0}/cloudpub/aws/utils.py +0 -0
  13. {cloudpub-1.3.3 → cloudpub-1.4.0}/cloudpub/common.py +0 -0
  14. {cloudpub-1.3.3 → cloudpub-1.4.0}/cloudpub/error.py +0 -0
  15. {cloudpub-1.3.3 → cloudpub-1.4.0}/cloudpub/models/__init__.py +0 -0
  16. {cloudpub-1.3.3 → cloudpub-1.4.0}/cloudpub/models/aws.py +0 -0
  17. {cloudpub-1.3.3 → cloudpub-1.4.0}/cloudpub/models/common.py +0 -0
  18. {cloudpub-1.3.3 → cloudpub-1.4.0}/cloudpub/models/ms_azure.py +0 -0
  19. {cloudpub-1.3.3 → cloudpub-1.4.0}/cloudpub/ms_azure/__init__.py +0 -0
  20. {cloudpub-1.3.3 → cloudpub-1.4.0}/cloudpub/ms_azure/session.py +0 -0
  21. {cloudpub-1.3.3 → cloudpub-1.4.0}/cloudpub/utils.py +0 -0
  22. {cloudpub-1.3.3 → cloudpub-1.4.0}/cloudpub.egg-info/SOURCES.txt +0 -0
  23. {cloudpub-1.3.3 → cloudpub-1.4.0}/cloudpub.egg-info/dependency_links.txt +0 -0
  24. {cloudpub-1.3.3 → cloudpub-1.4.0}/cloudpub.egg-info/not-zip-safe +0 -0
  25. {cloudpub-1.3.3 → cloudpub-1.4.0}/cloudpub.egg-info/requires.txt +0 -0
  26. {cloudpub-1.3.3 → cloudpub-1.4.0}/cloudpub.egg-info/top_level.txt +0 -0
  27. {cloudpub-1.3.3 → cloudpub-1.4.0}/requirements.txt +0 -0
  28. {cloudpub-1.3.3 → cloudpub-1.4.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cloudpub
3
- Version: 1.3.3
3
+ Version: 1.4.0
4
4
  Summary: Services for publishing products in cloud environments
5
5
  Home-page: https://github.com/release-engineering/cloudpub
6
6
  Author: Jonathan Gangi
@@ -620,7 +620,7 @@ class AzureService(BaseService[AzurePublishingMetadata]):
620
620
  tech_config.disk_versions = [disk_version]
621
621
 
622
622
  # We just want to append a new image if the SAS is not already present.
623
- elif not is_sas_present(tech_config, metadata.image_path):
623
+ elif not is_sas_present(tech_config, metadata.image_path, metadata.check_base_sas_only):
624
624
  # Here we can have the metadata.disk_version set or empty.
625
625
  # When set we want to get the existing disk_version which matches its value.
626
626
  log.debug("Scanning the disk versions from %s" % metadata.destination)
@@ -51,6 +51,9 @@ class AzurePublishingMetadata(PublishingMetadata):
51
51
  legacy_sku_id (str, optional):
52
52
  Only required when ``support_legacy == True``. The SKU ID for Gen1.
53
53
  Defaults to ``{sku_id}-gen1``
54
+ check_base_sas_only (bool, optional):
55
+ Indicates to skip checking SAS parameters when set as ``True``.
56
+ Default to ``False``
54
57
  **kwargs
55
58
  Arguments for :class:`~cloudpub.common.PublishingMetadata`.
56
59
  """
@@ -60,6 +63,7 @@ class AzurePublishingMetadata(PublishingMetadata):
60
63
  self.support_legacy = support_legacy
61
64
  self.recommended_sizes = recommended_sizes or []
62
65
  self.legacy_sku_id = kwargs.pop("legacy_sku_id", None)
66
+ self.check_base_sas_only = kwargs.pop("check_base_sas_only", False)
63
67
 
64
68
  if generation == "V1" or not support_legacy:
65
69
  self.legacy_sku_id = None
@@ -113,7 +117,7 @@ def get_image_type_mapping(architecture: str, generation: str) -> str:
113
117
  return gen_map.get(generation, "")
114
118
 
115
119
 
116
- def is_sas_eq(sas1: str, sas2: str) -> bool:
120
+ def is_sas_eq(sas1: str, sas2: str, base_only=False) -> bool:
117
121
  """
118
122
  Compare 2 SAS URI and determine where they're equivalent.
119
123
 
@@ -127,10 +131,12 @@ def is_sas_eq(sas1: str, sas2: str) -> bool:
127
131
  This comparison is necessary as each time a SAS URI is generated it returns a different value.
128
132
 
129
133
  Args:
130
- sas1:
134
+ sas1 (str):
131
135
  The left SAS to compare the equivalency
132
- sas2:
136
+ sas2 (str):
133
137
  The right SAS to compare the equivalency
138
+ base_only (bool):
139
+ When True it will only compare the base SAS and not its arguments. Defaults to False.
134
140
 
135
141
  Returns:
136
142
  True when both SAS URIs are equivalent, False otherwise.
@@ -147,25 +153,26 @@ def is_sas_eq(sas1: str, sas2: str) -> bool:
147
153
  log.debug("Got different base SAS: %s - Expected: %s" % (base_sas1, base_sas2))
148
154
  return False
149
155
 
150
- # Parameters lengh differs
151
- if len(params_sas1) != len(params_sas2):
152
- log.debug(
153
- "Got different lengh of SAS parameters: len(%s) - Expected len(%s)"
154
- % (params_sas1, params_sas2)
155
- )
156
- return False
157
-
158
- # Parameters values differs
159
- for k, v in params_sas1.items():
160
- if v != params_sas2.get(k, None):
161
- log.debug("The SAS parameter %s doesn't match %s." % (v, params_sas2.get(k, None)))
156
+ if not base_only:
157
+ # Parameters lengh differs
158
+ if len(params_sas1) != len(params_sas2):
159
+ log.debug(
160
+ "Got different lengh of SAS parameters: len(%s) - Expected len(%s)"
161
+ % (params_sas1, params_sas2)
162
+ )
162
163
  return False
163
164
 
165
+ # Parameters values differs
166
+ for k, v in params_sas1.items():
167
+ if v != params_sas2.get(k, None):
168
+ log.debug("The SAS parameter %s doesn't match %s." % (v, params_sas2.get(k, None)))
169
+ return False
170
+
164
171
  # Equivalent SAS
165
172
  return True
166
173
 
167
174
 
168
- def is_sas_present(tech_config: VMIPlanTechConfig, sas_uri: str) -> bool:
175
+ def is_sas_present(tech_config: VMIPlanTechConfig, sas_uri: str, base_only: bool = False) -> bool:
169
176
  """
170
177
  Check whether the given SAS URI is already present in the disk_version.
171
178
 
@@ -174,12 +181,14 @@ def is_sas_present(tech_config: VMIPlanTechConfig, sas_uri: str) -> bool:
174
181
  The plan's technical configuraion to seek the SAS_URI.
175
182
  sas_uri (str)
176
183
  The SAS URI to check whether it's present or not in disk version.
184
+ base_only (bool):
185
+ When True it will only compare the base SAS and not its arguments. Defaults to False.
177
186
  Returns:
178
187
  bool: True when the SAS is present in the plan, False otherwise.
179
188
  """
180
189
  for disk_version in tech_config.disk_versions:
181
190
  for img in disk_version.vm_images:
182
- if is_sas_eq(img.source.os_disk.uri, sas_uri):
191
+ if is_sas_eq(img.source.os_disk.uri, sas_uri, base_only):
183
192
  return True
184
193
  return False
185
194
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cloudpub
3
- Version: 1.3.3
3
+ Version: 1.4.0
4
4
  Summary: Services for publishing products in cloud environments
5
5
  Home-page: https://github.com/release-engineering/cloudpub
6
6
  Author: Jonathan Gangi
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
3
3
  setup(
4
4
  name='cloudpub',
5
5
  description='Services for publishing products in cloud environments',
6
- version='1.3.3',
6
+ version='1.4.0',
7
7
  keywords='stratosphere cloudpub cloudpublish',
8
8
  author='Jonathan Gangi',
9
9
  author_email='jgangi@redhat.com',
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes