Skip to content

Commit

Permalink
Bug Fix: Enable CSP Configuration (#161)
Browse files Browse the repository at this point in the history
Co-authored-by: Auto Black <auto-black@noreply.github.com>
  • Loading branch information
dciborow and Auto Black authored Sep 21, 2022
1 parent ec709f2 commit 470f706
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
4 changes: 3 additions & 1 deletion azureiai/managed_apps/confs/reseller_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
from azureiai.managed_apps.confs.offer_configurations import OfferConfigurations
from swagger_client import ResellerConfigurationApi

DEFAULT_STATE = "Enabled"


class ResellerConfiguration(OfferConfigurations):
"""Managed Application Offer - Reseller Configuration Configuration"""
Expand All @@ -21,7 +23,7 @@ def get(self):
product_id=self.product_id, authorization=self.authorization
)

def set(self, reseller_channel_state="Enabled"):
def set(self, reseller_channel_state=DEFAULT_STATE):
"""
Set Availability for Application
Expand Down
11 changes: 10 additions & 1 deletion azureiai/partner_center/submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import os
from pathlib import Path

from azureiai.managed_apps.confs import Properties, ProductAvailability, Listing, ListingImage
from azureiai.managed_apps.confs import Properties, ProductAvailability, Listing, ListingImage, ResellerConfiguration
from azureiai.managed_apps.confs.reseller_configuration import DEFAULT_STATE
from azureiai.partner_center.offer import Offer
from swagger_client.rest import ApiException

Expand Down Expand Up @@ -151,6 +152,14 @@ def _update_properties(self):
leveled_categories=leveled_categories,
)

def _set_resell_through_csps(self):
with open(Path(self.app_path).joinpath(self.json_listing_config), "r", encoding="utf8") as read_file:
json_config = json.load(read_file)
reseller_channel_state = json_config["offer_listing"].get("reseller_channel", DEFAULT_STATE)

reseller = ResellerConfiguration(product_id=self.get_product_id(), authorization=self.get_auth())
reseller.set(reseller_channel_state=reseller_channel_state)

def _update_preview_audience(self):
with open(Path(self.app_path).joinpath(self.json_listing_config), "r", encoding="utf8") as read_file:
json_config = json.load(read_file)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
generate_swagger(SWAGGER_JSON)

NAME = "az-partner-center-cli"
VERSION = "0.0.42"
VERSION = "0.0.43"

REQUIRES = [
"azure-mgmt-deploymentmanager",
Expand Down

0 comments on commit 470f706

Please sign in to comment.