cloudpub 1.3.2__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.2/cloudpub.egg-info → cloudpub-1.4.0}/PKG-INFO +1 -1
  2. {cloudpub-1.3.2 → cloudpub-1.4.0}/cloudpub/ms_azure/service.py +1 -1
  3. {cloudpub-1.3.2 → cloudpub-1.4.0}/cloudpub/ms_azure/utils.py +37 -23
  4. {cloudpub-1.3.2 → cloudpub-1.4.0/cloudpub.egg-info}/PKG-INFO +1 -1
  5. {cloudpub-1.3.2 → cloudpub-1.4.0}/requirements.txt +18 -18
  6. {cloudpub-1.3.2 → cloudpub-1.4.0}/setup.py +1 -1
  7. {cloudpub-1.3.2 → cloudpub-1.4.0}/LICENSE +0 -0
  8. {cloudpub-1.3.2 → cloudpub-1.4.0}/MANIFEST.in +0 -0
  9. {cloudpub-1.3.2 → cloudpub-1.4.0}/README.md +0 -0
  10. {cloudpub-1.3.2 → cloudpub-1.4.0}/cloudpub/__init__.py +0 -0
  11. {cloudpub-1.3.2 → cloudpub-1.4.0}/cloudpub/aws/__init__.py +0 -0
  12. {cloudpub-1.3.2 → cloudpub-1.4.0}/cloudpub/aws/service.py +0 -0
  13. {cloudpub-1.3.2 → cloudpub-1.4.0}/cloudpub/aws/utils.py +0 -0
  14. {cloudpub-1.3.2 → cloudpub-1.4.0}/cloudpub/common.py +0 -0
  15. {cloudpub-1.3.2 → cloudpub-1.4.0}/cloudpub/error.py +0 -0
  16. {cloudpub-1.3.2 → cloudpub-1.4.0}/cloudpub/models/__init__.py +0 -0
  17. {cloudpub-1.3.2 → cloudpub-1.4.0}/cloudpub/models/aws.py +0 -0
  18. {cloudpub-1.3.2 → cloudpub-1.4.0}/cloudpub/models/common.py +0 -0
  19. {cloudpub-1.3.2 → cloudpub-1.4.0}/cloudpub/models/ms_azure.py +0 -0
  20. {cloudpub-1.3.2 → cloudpub-1.4.0}/cloudpub/ms_azure/__init__.py +0 -0
  21. {cloudpub-1.3.2 → cloudpub-1.4.0}/cloudpub/ms_azure/session.py +0 -0
  22. {cloudpub-1.3.2 → cloudpub-1.4.0}/cloudpub/utils.py +0 -0
  23. {cloudpub-1.3.2 → cloudpub-1.4.0}/cloudpub.egg-info/SOURCES.txt +0 -0
  24. {cloudpub-1.3.2 → cloudpub-1.4.0}/cloudpub.egg-info/dependency_links.txt +0 -0
  25. {cloudpub-1.3.2 → cloudpub-1.4.0}/cloudpub.egg-info/not-zip-safe +0 -0
  26. {cloudpub-1.3.2 → cloudpub-1.4.0}/cloudpub.egg-info/requires.txt +0 -0
  27. {cloudpub-1.3.2 → cloudpub-1.4.0}/cloudpub.egg-info/top_level.txt +0 -0
  28. {cloudpub-1.3.2 → 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.2
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
 
@@ -262,11 +271,16 @@ def prepare_vm_images(
262
271
  return [VMImageDefinition.from_json(json_gen1)]
263
272
 
264
273
 
265
- def _len_vm_images(disk_versions: List[DiskVersion]) -> int:
266
- count = 0
267
- for disk_version in disk_versions:
268
- count = count + len(disk_version.vm_images)
269
- return count
274
+ def _all_skus_present(old_skus: List[VMISku], disk_versions: List[DiskVersion]) -> bool:
275
+ image_types = set()
276
+ for sku in old_skus:
277
+ image_types.add(sku.image_type)
278
+
279
+ for dv in disk_versions:
280
+ for img in dv.vm_images:
281
+ if img.image_type not in image_types:
282
+ return False
283
+ return True
270
284
 
271
285
 
272
286
  def _build_skus(
@@ -352,7 +366,7 @@ def update_skus(
352
366
 
353
367
  # If we have SKUs for each image we don't need to update them as they're already
354
368
  # properly set.
355
- if len(old_skus) == _len_vm_images(disk_versions):
369
+ if _all_skus_present(old_skus, disk_versions):
356
370
  return old_skus
357
371
 
358
372
  # Update SKUs to create the alternate gen.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cloudpub
3
- Version: 1.3.2
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
@@ -8,13 +8,13 @@ attrs==25.3.0 \
8
8
  --hash=sha256:427318ce031701fea540783410126f03899a97ffc6f61596ad581ac2e40e3bc3 \
9
9
  --hash=sha256:75d7cefc7fb576747b2c81b4442d4d4a1ce0900973527c011d1030fd3bf4af1b
10
10
  # via cloudpub (setup.py)
11
- boto3==1.37.23 \
12
- --hash=sha256:82f4599a34f5eb66e916b9ac8547394f6e5899c19580e74b60237db04cf66d1e \
13
- --hash=sha256:fc462b9fd738bd8a1c121d94d237c6b6a05a2c1cc709d16f5223acb752f7310b
11
+ boto3==1.37.37 \
12
+ --hash=sha256:752d31105a45e3e01c8c68471db14ae439990b75a35e72b591ca528e2575b28f \
13
+ --hash=sha256:d125cb11e22817f7a2581bade4bf7b75247b401888890239ceb5d3e902ccaf38
14
14
  # via cloudpub (setup.py)
15
- botocore==1.37.23 \
16
- --hash=sha256:3a249c950cef9ee9ed7b2278500ad83a4ad6456bc433a43abd1864d1b61b2acb \
17
- --hash=sha256:ffbe1f5958adb1c50d72d3ad1018cb265fe349248c08782d334601c0814f0e38
15
+ botocore==1.37.37 \
16
+ --hash=sha256:3eadde6fed95c4cb469cc39d1c3558528b7fa76d23e7e16d4bddc77250431a64 \
17
+ --hash=sha256:eb730ff978f47c02f0c8ed07bccdc0db6d8fa098ed32ac31bee1da0e9be480d1
18
18
  # via
19
19
  # boto3
20
20
  # s3transfer
@@ -130,13 +130,13 @@ jmespath==1.0.1 \
130
130
  # via
131
131
  # boto3
132
132
  # botocore
133
- orderly-set==5.3.0 \
134
- --hash=sha256:80b3d8fdd3d39004d9aad389eaa0eab02c71f0a0511ba3a6d54a935a6c6a0acc \
135
- --hash=sha256:c2c0bfe604f5d3d9b24e8262a06feb612594f37aa3845650548befd7772945d1
133
+ orderly-set==5.4.0 \
134
+ --hash=sha256:c8ff5ba824abe4eebcbbdd3f646ff3648ad0dd52239319d90056d8d30b6cccdd \
135
+ --hash=sha256:f0192a7f9ae3385b587b71688353fae491d1ca45878496eb71ea118be1623639
136
136
  # via deepdiff
137
- packaging==24.2 \
138
- --hash=sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759 \
139
- --hash=sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f
137
+ packaging==25.0 \
138
+ --hash=sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484 \
139
+ --hash=sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f
140
140
  # via cloudpub (setup.py)
141
141
  python-dateutil==2.9.0.post0 \
142
142
  --hash=sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3 \
@@ -146,17 +146,17 @@ requests==2.32.3 \
146
146
  --hash=sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760 \
147
147
  --hash=sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6
148
148
  # via cloudpub (setup.py)
149
- s3transfer==0.11.4 \
150
- --hash=sha256:559f161658e1cf0a911f45940552c696735f5c74e64362e515f333ebed87d679 \
151
- --hash=sha256:ac265fa68318763a03bf2dc4f39d5cbd6a9e178d81cc9483ad27da33637e320d
149
+ s3transfer==0.11.5 \
150
+ --hash=sha256:757af0f2ac150d3c75bc4177a32355c3862a98d20447b69a0161812992fe0bd4 \
151
+ --hash=sha256:8c8aad92784779ab8688a61aefff3e28e9ebdce43142808eaa3f0b0f402f68b7
152
152
  # via boto3
153
153
  six==1.17.0 \
154
154
  --hash=sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274 \
155
155
  --hash=sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81
156
156
  # via python-dateutil
157
- tenacity==9.0.0 \
158
- --hash=sha256:807f37ca97d62aa361264d497b0e31e92b8027044942bfa756160d908320d73b \
159
- --hash=sha256:93de0c98785b27fcf659856aa9f54bfbd399e29969b0621bc7f762bd441b4539
157
+ tenacity==9.1.2 \
158
+ --hash=sha256:1169d376c297e7de388d18b4481760d478b0e99a777cad3a9c86e556f4b697cb \
159
+ --hash=sha256:f77bf36710d8b73a50b2dd155c97b870017ad21afe6ab300326b0371b3b05138
160
160
  # via cloudpub (setup.py)
161
161
  urllib3==1.26.20 \
162
162
  --hash=sha256:0ed14ccfbf1c30a9072c7ca157e4319b70d65f623e91e7b32fadb2853431016e \
@@ -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.2',
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