From 595cfec57233728feeafbdb3131daeffdb95b778 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Sat, 30 Nov 2019 23:29:16 +0100 Subject: [PATCH] Adapt order dependency impl to python types impl --- cdist/__init__.py | 3 +++ cdist/core/manifest.py | 7 ++----- cdist/emulator.py | 5 ++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/cdist/__init__.py b/cdist/__init__.py index c673b3ba..279fd502 100644 --- a/cdist/__init__.py +++ b/cdist/__init__.py @@ -47,6 +47,9 @@ REMOTE_COPY = "scp -o User=root -q" REMOTE_EXEC = "ssh -o User=root" 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): """Base exception class for this project""" diff --git a/cdist/core/manifest.py b/cdist/core/manifest.py index 16dec465..84bc813f 100644 --- a/cdist/core/manifest.py +++ b/cdist/core/manifest.py @@ -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): self.target_host = target_host self.local = local @@ -227,8 +224,8 @@ class Manifest(object): os.remove(os.path.join(self.local.base_path, fname)) except FileNotFoundError: pass - _rm_file(Manifest.ORDER_DEP_STATE_NAME) - _rm_file(Manifest.TYPEORDER_DEP_NAME) + _rm_file(cdist.ORDER_DEP_STATE_NAME) + _rm_file(cdist.TYPEORDER_DEP_NAME) def env_py_type_manifest(self, cdist_object): env = os.environ.copy() diff --git a/cdist/emulator.py b/cdist/emulator.py index 7dc24a83..00060a10 100644 --- a/cdist/emulator.py +++ b/cdist/emulator.py @@ -29,7 +29,6 @@ import sys import cdist from cdist import core from cdist import flock -from cdist.core.manifest import Manifest import cdist.util.python_type_util as pytype_util from cdist.core.pytypes import get_pytype_class import inspect @@ -87,9 +86,9 @@ class Emulator(object): self.typeorder_path = os.path.join(self.global_path, "typeorder") 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, - Manifest.ORDER_DEP_STATE_NAME) + cdist.ORDER_DEP_STATE_NAME) self.type_name = os.path.basename(argv[0]) self.cdist_type = core.CdistType(self.type_base_path, self.type_name)