Skip to content

Commit

Permalink
Merge pull request #12 from release-engineering/leftover
Browse files Browse the repository at this point in the history
Clean up the code
  • Loading branch information
JAVGan authored Jul 18, 2024
2 parents 7f915c1 + 404b5ae commit 7b5ed6f
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cloudpub/aws/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ def publish(self, metadata: AWSVersionMetadata) -> None:
change_set["ChangeType"] = "UpdateDeliveryOptions"
change_set["DetailsDocument"] = json_mapping.to_json()

if metadata.keepdraft or metadata.preview_only:
if metadata.keepdraft:
log.info("Sending draft version to %s.", metadata.marketplace_entity_type)
rsp: ChangeSetResponse = self.marketplace.start_change_set(
Catalog="AWSMarketplace", ChangeSet=[change_set], Intent="VALIDATE"
Expand Down
5 changes: 0 additions & 5 deletions cloudpub/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ def __init__(
destination: str,
overwrite: bool = False,
keepdraft: bool = False,
preview_only: bool = False,
) -> None:
"""
Create an instanece of PublishingMetadata.
Expand All @@ -39,16 +38,12 @@ def __init__(
Whether to just associate the VM Image with the destination but avoid publishing or not.
When set to `False` it will publish the content as GA.
This defaults to `True`.
preview_only (boolean, optional)
Whether the final publish status should be ``preview`` (``True``)
or ``live`` (``False``). Defaults to ``False``.
"""
self.image_path = image_path
self.architecture = architecture
self.destination = destination
self.overwrite = overwrite
self.keepdraft = keepdraft
self.preview_only = preview_only
self.__validate()

def __validate(self):
Expand Down
4 changes: 1 addition & 3 deletions cloudpub/ms_azure/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,4 @@ def publish(self, metadata: AzurePublishingMetadata) -> None:
self.ensure_can_publish(product.id)

self._publish_preview(product, product_name)

if not metadata.preview_only:
self._publish_live(product, product_name)
self._publish_live(product, product_name)
3 changes: 0 additions & 3 deletions docs/cloud_providers/models/aws.rst.incl
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ AWS Version Mapping
.. autoclass:: cloudpub.models.aws.VersionMapping()
:members:

.. autoclass:: cloudpub.models.aws.DeliveryOptions()
:members:

.. autoclass:: cloudpub.models.aws.DeliveryOption()
:members:

Expand Down

0 comments on commit 7b5ed6f

Please sign in to comment.