Use new style classes

Change a couple of old style classes into the newer styled ones.

Change-Id: Ide3bbcd2d24f949a2a550fcc2210617f34c8cd0b
This commit is contained in:
Angus Salkeld 2013-07-23 11:26:05 +10:00
parent 5224fcd934
commit e3caef4452
10 changed files with 15 additions and 15 deletions

View File

@ -20,7 +20,7 @@ from heat.api.aws import exception
import heat.openstack.common.rpc.common as rpc_common
class WaitConditionController:
class WaitConditionController(object):
def __init__(self, options):
self.options = options
self.engine = rpc_client.EngineClient()

View File

@ -42,7 +42,7 @@ def init_logging():
def call(args):
class LogStream:
class LogStream(object):
def write(self, data):
LOG.info(data)

View File

@ -97,7 +97,7 @@ class FakeClient(object):
pass
class FakeKeystoneClient():
class FakeKeystoneClient(object):
def __init__(self, username='test_user', user_id='1234', access='4567',
secret='8901'):
self.username = username
@ -116,7 +116,7 @@ class FakeKeystoneClient():
def get_ec2_keypair(self, user_id):
if user_id == self.user_id:
if not self.creds:
class FakeCred:
class FakeCred(object):
access = self.access
secret = self.secret
self.creds = FakeCred()

View File

@ -174,7 +174,7 @@ class Ec2TokenTest(HeatTestCase):
def _stub_http_connection(self, headers={}, params={}, response=None):
class DummyHTTPResponse:
class DummyHTTPResponse(object):
resp = response
def read(self):

View File

@ -72,11 +72,11 @@ class DBInstanceTest(HeatTestCase):
def test_dbinstance(self):
class FakeDatabaseInstance:
class FakeDatabaseInstance(object):
def _ipaddress(self):
return '10.0.0.1'
class FakeNested:
class FakeNested(object):
resources = {'DatabaseInstance': FakeDatabaseInstance()}
params = {'DBSecurityGroups': '',

View File

@ -1262,7 +1262,7 @@ class StackServiceTest(HeatTestCase):
state='NORMAL')
self.wr.store()
class DummyAction:
class DummyAction(object):
alarm = "dummyfoo"
dummy_action = DummyAction()

View File

@ -22,12 +22,12 @@ from heat.cloudinit import loguserdata
from heat.tests.common import HeatTestCase
class FakeCiVersion():
class FakeCiVersion(object):
def __init__(self, version=None):
self.version = version
class FakePOpen():
class FakePOpen(object):
def __init__(self, returncode=0):
self.returncode = returncode

View File

@ -467,7 +467,7 @@ Mappings:
deletion_policy_snippet = {'Fn::ResourceFacade': 'DeletionPolicy'}
update_policy_snippet = {'Fn::ResourceFacade': 'UpdatePolicy'}
class DummyClass:
class DummyClass(object):
pass
parent_resource = DummyClass()
parent_resource.metadata = '{"foo": "bar"}'
@ -497,7 +497,7 @@ Mappings:
def test_resource_facade_missing_key(self):
snippet = {'Fn::ResourceFacade': 'DeletionPolicy'}
class DummyClass:
class DummyClass(object):
pass
parent_resource = DummyClass()
parent_resource.metadata = '{"foo": "bar"}'

View File

@ -676,7 +676,7 @@ class VolumeTest(HeatTestCase):
self.m.VerifyAll()
class FakeVolume:
class FakeVolume(object):
status = 'attaching'
id = 'vol-123'

View File

@ -26,14 +26,14 @@ from heat.tests import utils
from heat.tests.utils import dummy_context
class WatchData:
class WatchData(object):
def __init__(self, data, created_at):
self.created_at = created_at
self.data = {'test_metric': {'Value': data,
'Unit': 'Count'}}
class DummyAction:
class DummyAction(object):
alarm = "DummyAction"