Use new style classes
Change a couple of old style classes into the newer styled ones. Change-Id: Ide3bbcd2d24f949a2a550fcc2210617f34c8cd0b
This commit is contained in:
parent
5224fcd934
commit
e3caef4452
|
@ -20,7 +20,7 @@ from heat.api.aws import exception
|
||||||
import heat.openstack.common.rpc.common as rpc_common
|
import heat.openstack.common.rpc.common as rpc_common
|
||||||
|
|
||||||
|
|
||||||
class WaitConditionController:
|
class WaitConditionController(object):
|
||||||
def __init__(self, options):
|
def __init__(self, options):
|
||||||
self.options = options
|
self.options = options
|
||||||
self.engine = rpc_client.EngineClient()
|
self.engine = rpc_client.EngineClient()
|
||||||
|
|
|
@ -42,7 +42,7 @@ def init_logging():
|
||||||
|
|
||||||
def call(args):
|
def call(args):
|
||||||
|
|
||||||
class LogStream:
|
class LogStream(object):
|
||||||
|
|
||||||
def write(self, data):
|
def write(self, data):
|
||||||
LOG.info(data)
|
LOG.info(data)
|
||||||
|
|
|
@ -97,7 +97,7 @@ class FakeClient(object):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class FakeKeystoneClient():
|
class FakeKeystoneClient(object):
|
||||||
def __init__(self, username='test_user', user_id='1234', access='4567',
|
def __init__(self, username='test_user', user_id='1234', access='4567',
|
||||||
secret='8901'):
|
secret='8901'):
|
||||||
self.username = username
|
self.username = username
|
||||||
|
@ -116,7 +116,7 @@ class FakeKeystoneClient():
|
||||||
def get_ec2_keypair(self, user_id):
|
def get_ec2_keypair(self, user_id):
|
||||||
if user_id == self.user_id:
|
if user_id == self.user_id:
|
||||||
if not self.creds:
|
if not self.creds:
|
||||||
class FakeCred:
|
class FakeCred(object):
|
||||||
access = self.access
|
access = self.access
|
||||||
secret = self.secret
|
secret = self.secret
|
||||||
self.creds = FakeCred()
|
self.creds = FakeCred()
|
||||||
|
|
|
@ -174,7 +174,7 @@ class Ec2TokenTest(HeatTestCase):
|
||||||
|
|
||||||
def _stub_http_connection(self, headers={}, params={}, response=None):
|
def _stub_http_connection(self, headers={}, params={}, response=None):
|
||||||
|
|
||||||
class DummyHTTPResponse:
|
class DummyHTTPResponse(object):
|
||||||
resp = response
|
resp = response
|
||||||
|
|
||||||
def read(self):
|
def read(self):
|
||||||
|
|
|
@ -72,11 +72,11 @@ class DBInstanceTest(HeatTestCase):
|
||||||
|
|
||||||
def test_dbinstance(self):
|
def test_dbinstance(self):
|
||||||
|
|
||||||
class FakeDatabaseInstance:
|
class FakeDatabaseInstance(object):
|
||||||
def _ipaddress(self):
|
def _ipaddress(self):
|
||||||
return '10.0.0.1'
|
return '10.0.0.1'
|
||||||
|
|
||||||
class FakeNested:
|
class FakeNested(object):
|
||||||
resources = {'DatabaseInstance': FakeDatabaseInstance()}
|
resources = {'DatabaseInstance': FakeDatabaseInstance()}
|
||||||
|
|
||||||
params = {'DBSecurityGroups': '',
|
params = {'DBSecurityGroups': '',
|
||||||
|
|
|
@ -1262,7 +1262,7 @@ class StackServiceTest(HeatTestCase):
|
||||||
state='NORMAL')
|
state='NORMAL')
|
||||||
self.wr.store()
|
self.wr.store()
|
||||||
|
|
||||||
class DummyAction:
|
class DummyAction(object):
|
||||||
alarm = "dummyfoo"
|
alarm = "dummyfoo"
|
||||||
|
|
||||||
dummy_action = DummyAction()
|
dummy_action = DummyAction()
|
||||||
|
|
|
@ -22,12 +22,12 @@ from heat.cloudinit import loguserdata
|
||||||
from heat.tests.common import HeatTestCase
|
from heat.tests.common import HeatTestCase
|
||||||
|
|
||||||
|
|
||||||
class FakeCiVersion():
|
class FakeCiVersion(object):
|
||||||
def __init__(self, version=None):
|
def __init__(self, version=None):
|
||||||
self.version = version
|
self.version = version
|
||||||
|
|
||||||
|
|
||||||
class FakePOpen():
|
class FakePOpen(object):
|
||||||
def __init__(self, returncode=0):
|
def __init__(self, returncode=0):
|
||||||
self.returncode = returncode
|
self.returncode = returncode
|
||||||
|
|
||||||
|
|
|
@ -467,7 +467,7 @@ Mappings:
|
||||||
deletion_policy_snippet = {'Fn::ResourceFacade': 'DeletionPolicy'}
|
deletion_policy_snippet = {'Fn::ResourceFacade': 'DeletionPolicy'}
|
||||||
update_policy_snippet = {'Fn::ResourceFacade': 'UpdatePolicy'}
|
update_policy_snippet = {'Fn::ResourceFacade': 'UpdatePolicy'}
|
||||||
|
|
||||||
class DummyClass:
|
class DummyClass(object):
|
||||||
pass
|
pass
|
||||||
parent_resource = DummyClass()
|
parent_resource = DummyClass()
|
||||||
parent_resource.metadata = '{"foo": "bar"}'
|
parent_resource.metadata = '{"foo": "bar"}'
|
||||||
|
@ -497,7 +497,7 @@ Mappings:
|
||||||
def test_resource_facade_missing_key(self):
|
def test_resource_facade_missing_key(self):
|
||||||
snippet = {'Fn::ResourceFacade': 'DeletionPolicy'}
|
snippet = {'Fn::ResourceFacade': 'DeletionPolicy'}
|
||||||
|
|
||||||
class DummyClass:
|
class DummyClass(object):
|
||||||
pass
|
pass
|
||||||
parent_resource = DummyClass()
|
parent_resource = DummyClass()
|
||||||
parent_resource.metadata = '{"foo": "bar"}'
|
parent_resource.metadata = '{"foo": "bar"}'
|
||||||
|
|
|
@ -676,7 +676,7 @@ class VolumeTest(HeatTestCase):
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
|
|
||||||
class FakeVolume:
|
class FakeVolume(object):
|
||||||
status = 'attaching'
|
status = 'attaching'
|
||||||
id = 'vol-123'
|
id = 'vol-123'
|
||||||
|
|
||||||
|
|
|
@ -26,14 +26,14 @@ from heat.tests import utils
|
||||||
from heat.tests.utils import dummy_context
|
from heat.tests.utils import dummy_context
|
||||||
|
|
||||||
|
|
||||||
class WatchData:
|
class WatchData(object):
|
||||||
def __init__(self, data, created_at):
|
def __init__(self, data, created_at):
|
||||||
self.created_at = created_at
|
self.created_at = created_at
|
||||||
self.data = {'test_metric': {'Value': data,
|
self.data = {'test_metric': {'Value': data,
|
||||||
'Unit': 'Count'}}
|
'Unit': 'Count'}}
|
||||||
|
|
||||||
|
|
||||||
class DummyAction:
|
class DummyAction(object):
|
||||||
alarm = "DummyAction"
|
alarm = "DummyAction"
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue