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):
|
if operating_system.get_os() == operating_system.REDHAT:
|
||||||
|
class Package(RedhatPackagerMixin):
|
||||||
def __new__(meta, name, bases, dct):
|
pass
|
||||||
if operating_system.get_os() == operating_system.REDHAT:
|
else:
|
||||||
bases += (RedhatPackagerMixin, )
|
class Package(DebianPackagerMixin):
|
||||||
else:
|
|
||||||
# The default is debian
|
|
||||||
bases += (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