# Path: poni/util.py
# DEF_VALUE = object()  # used as default value where None cannot be used
# def get_dict_prop(item, address, verify=False):
# def set_dict_prop(item, address, value, verify=False, schema=None):
# def json_dump(data, file_path):
# def parse_prop(prop_str, converters=None):
# def parse_count(count_str):
# def format_error(error):
# def dir_stats(dir_path):
# def path_iter_dict(dict_obj, prefix=None):
# def hash_any(ob):
#     def __hash__(self):
#     def __getattr__(self, name):
#     def __init__(self, task_count=10):
#     def __reduce__(self):
#     def _call_wrapper(self, method, method_args, method_kwargs=None):
#     def apply_async(self, method, args=(), kwds=None, callback=None):  # pylint: disable=W0221
#     def wait_all(self):
# class hashed_dict(dict):
# class PropDict(dict):
# class TaskPool(ThreadPool):


from . import errors
from . import newconfig
from . import rcontrol_all
from . import util
from . import vc
from .util import json
import codecs
import imp
import os
import re
import shutil
import sys
    def get_system_dir(self, name, must_exist=True):
        return ensure_dir("system", self.system_root, name, must_exist)

    def get_node_dir(self, system, name, must_exist=True):
        return ensure_dir("node", self.get_system_dir(system), name,
                          must_exist)

    def create_system(self, name):
        system_dir = self.get_system_dir(name, must_exist=False)
        os.makedirs(system_dir)
        spec_file = os.path.join(system_dir, SYSTEM_CONF_FILE)
        util.json_dump({}, spec_file)
        return system_dir

    def system_exists(self, name):
        return os.path.exists(os.path.join(self.system_root, name))

    def create_node(self, node, host=None, parent_node_name=None,
                    copy_props=None):
        system_dir, node_name = os.path.split(node)
        if not self.system_exists(system_dir):
            self.create_system(system_dir)

        node_dir = self.get_node_dir(system_dir, node_name, must_exist=False)
        os.makedirs(node_dir)
        spec_file = os.path.join(node_dir, NODE_CONF_FILE)

        if copy_props and parent_node_name:
            parent_node_conf = os.path.join(self.system_root, parent_node_name,
                                            NODE_CONF_FILE)

# Path: poni/util.py
# DEF_VALUE = object()  # used as default value where None cannot be used
# def get_dict_prop(item, address, verify=False):
# def set_dict_prop(item, address, value, verify=False, schema=None):
# def json_dump(data, file_path):
# def parse_prop(prop_str, converters=None):
# def parse_count(count_str):
# def format_error(error):
# def dir_stats(dir_path):
# def path_iter_dict(dict_obj, prefix=None):
# def hash_any(ob):
#     def __hash__(self):
#     def __getattr__(self, name):
#     def __init__(self, task_count=10):
#     def __reduce__(self):
#     def _call_wrapper(self, method, method_args, method_kwargs=None):
#     def apply_async(self, method, args=(), kwds=None, callback=None):  # pylint: disable=W0221
#     def wait_all(self):
# class hashed_dict(dict):
# class PropDict(dict):
# class TaskPool(ThreadPool):


# Path: poni/core.py
from . import errors
from . import newconfig
from . import rcontrol_all
from . import util
from . import vc
from .util import json
import codecs
import imp
import os
import re
import shutil
import sys

    def get_system_dir(self, name, must_exist=True):
        return ensure_dir("system", self.system_root, name, must_exist)

    def get_node_dir(self, system, name, must_exist=True):
        return ensure_dir("node", self.get_system_dir(system), name,
                          must_exist)

    def create_system(self, name):
        system_dir = self.get_system_dir(name, must_exist=False)
        os.makedirs(system_dir)
        spec_file = os.path.join(system_dir, SYSTEM_CONF_FILE)
        util.json_dump({}, spec_file)
        return system_dir

    def system_exists(self, name):
        return os.path.exists(os.path.join(self.system_root, name))

    def create_node(self, node, host=None, parent_node_name=None,
                    copy_props=None):
        system_dir, node_name = os.path.split(node)
        if not self.system_exists(system_dir):
            self.create_system(system_dir)

        node_dir = self.get_node_dir(system_dir, node_name, must_exist=False)
        os.makedirs(node_dir)
        spec_file = os.path.join(node_dir, NODE_CONF_FILE)

        if copy_props and parent_node_name:
            parent_node_conf = os.path.join(self.system_root, parent_node_name,
                                            NODE_CONF_FILE)

            spec = json.load(open(parent_node_conf))