Adapt order dependency impl to python types impl

This commit is contained in:
Darko Poljak 2019-11-30 23:29:16 +01:00
parent b7af305636
commit 595cfec572
3 changed files with 7 additions and 8 deletions

View file

@ -47,6 +47,9 @@ REMOTE_COPY = "scp -o User=root -q"
REMOTE_EXEC = "ssh -o User=root" REMOTE_EXEC = "ssh -o User=root"
REMOTE_CMDS_CLEANUP_PATTERN = "ssh -o User=root -O exit -S {}" REMOTE_CMDS_CLEANUP_PATTERN = "ssh -o User=root -O exit -S {}"
ORDER_DEP_STATE_NAME = 'order_dep_state'
TYPEORDER_DEP_NAME = 'typeorder_dep'
class Error(Exception): class Error(Exception):
"""Base exception class for this project""" """Base exception class for this project"""

View file

@ -100,9 +100,6 @@ class Manifest(object):
""" """
ORDER_DEP_STATE_NAME = 'order_dep_state'
TYPEORDER_DEP_NAME = 'typeorder_dep'
def __init__(self, target_host, local, dry_run=False): def __init__(self, target_host, local, dry_run=False):
self.target_host = target_host self.target_host = target_host
self.local = local self.local = local
@ -227,8 +224,8 @@ class Manifest(object):
os.remove(os.path.join(self.local.base_path, fname)) os.remove(os.path.join(self.local.base_path, fname))
except FileNotFoundError: except FileNotFoundError:
pass pass
_rm_file(Manifest.ORDER_DEP_STATE_NAME) _rm_file(cdist.ORDER_DEP_STATE_NAME)
_rm_file(Manifest.TYPEORDER_DEP_NAME) _rm_file(cdist.TYPEORDER_DEP_NAME)
def env_py_type_manifest(self, cdist_object): def env_py_type_manifest(self, cdist_object):
env = os.environ.copy() env = os.environ.copy()

View file

@ -29,7 +29,6 @@ import sys
import cdist import cdist
from cdist import core from cdist import core
from cdist import flock from cdist import flock
from cdist.core.manifest import Manifest
import cdist.util.python_type_util as pytype_util import cdist.util.python_type_util as pytype_util
from cdist.core.pytypes import get_pytype_class from cdist.core.pytypes import get_pytype_class
import inspect import inspect
@ -87,9 +86,9 @@ class Emulator(object):
self.typeorder_path = os.path.join(self.global_path, "typeorder") self.typeorder_path = os.path.join(self.global_path, "typeorder")
self.typeorder_dep_path = os.path.join(self.global_path, self.typeorder_dep_path = os.path.join(self.global_path,
Manifest.TYPEORDER_DEP_NAME) cdist.TYPEORDER_DEP_NAME)
self.order_dep_state_path = os.path.join(self.global_path, self.order_dep_state_path = os.path.join(self.global_path,
Manifest.ORDER_DEP_STATE_NAME) cdist.ORDER_DEP_STATE_NAME)
self.type_name = os.path.basename(argv[0]) self.type_name = os.path.basename(argv[0])
self.cdist_type = core.CdistType(self.type_base_path, self.type_name) self.cdist_type = core.CdistType(self.type_base_path, self.type_name)