Skip to content

Commit

Permalink
Adding log_delivery parameter to CDN create_service
Browse files Browse the repository at this point in the history
  • Loading branch information
vikomall committed Sep 10, 2015
1 parent 469bd18 commit 6027890
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions pyrax/cloudcdn.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,15 @@ def delete_assets(self, url=None, all=False):
class CloudCDNServiceManager(BaseManager):

def create(self, name, flavor_id, domains, origins,
restrictions=None, caching=None):
restrictions=None, caching=None, log_delivery=None):

body = {"name": name,
"flavor_id": flavor_id,
"domains": domains,
"origins": origins,
"restrictions": restrictions or [],
"caching": caching or []}
"caching": caching or [],
"log_delivery": log_delivery or {"enabled": False}}
resp, resp_body = self.api.method_post("/%s" % self.uri_base,
body=body)

Expand Down Expand Up @@ -150,7 +151,7 @@ def get_service(self, service_id):
return self._services_manager.get(service_id)

def create_service(self, name, flavor_id, domains, origins,
restrictions=None, caching=None):
restrictions=None, caching=None, log_delivery=None):
"""Create a new CDN service.
Arguments:
Expand All @@ -168,7 +169,8 @@ def create_service(self, name, flavor_id, domains, origins,
"""
return self._services_manager.create(name, flavor_id, domains, origins,
restrictions, caching)
restrictions, caching,
log_delivery)

def patch_service(self, service_id, changes):
"""Update a CDN service with a patch
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_cloud_cdn.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_get_service(self, mock_get):
@mock.patch("pyrax.cloudcdn.CloudCDNServiceManager.create")
def test_create_service(self, mock_create):
sot = CloudCDNClient(mock.MagicMock())
args = (1, 2, 3, 4, 5, 6)
args = (1, 2, 3, 4, 5, 6, 7)
sot.create_service(*args)
mock_create.assert_called_once_with(*args)

Expand Down

0 comments on commit 6027890

Please sign in to comment.