Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Merge branch 'cloudfront-logging' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
toastdriven committed Jul 23, 2013
2 parents 586dd54 + 1ab4223 commit e76180d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
8 changes: 4 additions & 4 deletions boto/cloudfront/distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from boto.cloudfront.origin import S3Origin, CustomOrigin
from boto.s3.acl import ACL

class DistributionConfig:
class DistributionConfig(object):

def __init__(self, connection=None, origin=None, enabled=False,
caller_reference='', cnames=None, comment='',
Expand Down Expand Up @@ -100,7 +100,7 @@ def __init__(self, connection=None, origin=None, enabled=False,
self.cnames = cnames
self.comment = comment
self.trusted_signers = trusted_signers
self.logging = None
self.logging = logging
self.default_root_object = default_root_object

def to_xml(self):
Expand Down Expand Up @@ -214,7 +214,7 @@ def to_xml(self):
s += '</StreamingDistributionConfig>\n'
return s

class DistributionSummary:
class DistributionSummary(object):

def __init__(self, connection=None, domain_name='', id='',
last_modified_time=None, status='', origin=None,
Expand Down Expand Up @@ -279,7 +279,7 @@ class StreamingDistributionSummary(DistributionSummary):
def get_distribution(self):
return self.connection.get_streaming_distribution_info(self.id)

class Distribution:
class Distribution(object):

def __init__(self, connection=None, config=None, domain_name='',
id='', last_modified_time=None, status=''):
Expand Down
21 changes: 21 additions & 0 deletions tests/unit/cloudfront/test_distribution.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import unittest

from boto.cloudfront.distribution import DistributionConfig
from boto.cloudfront.logging import LoggingInfo


class CloudfrontDistributionTest(unittest.TestCase):
cloudfront = True

def setUp(self):
self.dist = DistributionConfig()

def test_logging(self):
# Default.
self.assertEqual(self.dist.logging, None)

# Override.
lo = LoggingInfo(bucket='whatever', prefix='override_')
dist = DistributionConfig(logging=lo)
self.assertEqual(dist.logging.bucket, 'whatever')
self.assertEqual(dist.logging.prefix, 'override_')

0 comments on commit e76180d

Please sign in to comment.