Merge "Simplify guestagent.pkg: don't use metaclass"
This commit is contained in:
commit
75e1b7386a
@ -24,7 +24,6 @@ from tempfile import NamedTemporaryFile
|
|||||||
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import pexpect
|
import pexpect
|
||||||
import six
|
|
||||||
|
|
||||||
from trove.common import exception
|
from trove.common import exception
|
||||||
from trove.common.exception import ProcessExecutionError
|
from trove.common.exception import ProcessExecutionError
|
||||||
@ -80,7 +79,7 @@ class PkgConfigureError(exception.TroveError):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class BasePackagerMixin:
|
class BasePackagerMixin(object):
|
||||||
|
|
||||||
def pexpect_kill_proc(self, child):
|
def pexpect_kill_proc(self, child):
|
||||||
child.delayafterclose = 1
|
child.delayafterclose = 1
|
||||||
@ -414,17 +413,9 @@ class DebianPackagerMixin(BasePackagerMixin):
|
|||||||
% package_name)
|
% package_name)
|
||||||
|
|
||||||
|
|
||||||
class BasePackage(type):
|
|
||||||
|
|
||||||
def __new__(meta, name, bases, dct):
|
|
||||||
if operating_system.get_os() == operating_system.REDHAT:
|
if operating_system.get_os() == operating_system.REDHAT:
|
||||||
bases += (RedhatPackagerMixin, )
|
class Package(RedhatPackagerMixin):
|
||||||
else:
|
pass
|
||||||
# The default is debian
|
else:
|
||||||
bases += (DebianPackagerMixin,)
|
class Package(DebianPackagerMixin):
|
||||||
return super(BasePackage, meta).__new__(meta, name, bases, dct)
|
|
||||||
|
|
||||||
|
|
||||||
@six.add_metaclass(BasePackage)
|
|
||||||
class Package(object):
|
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user