<commit_before>#! /usr/bin/env claw
########
# Copyright (c) 2015 GigaSpaces Technologies Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#        http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
############

import os
import time

import sh

from claw import cosmo
from claw.commands import bake

package_dir = {
    'amqp_influxdb': 'cloudify-amqp-influxdb',
    'cloudify': 'cloudify-plugins-common',
    'cloudify_agent': 'cloudify-agent',
    'cloudify_handler': 'cloudify-diamond-plugin',
    'cloudify_rest_client': 'cloudify-rest-client',
    'diamond_agent': 'cloudify-diamond-plugin',
    'dsl_parser': 'cloudify-dsl-parser',
    'manager_rest': 'cloudify-manager/rest-service',
    'plugin_installer': 'cloudify-agent',
    'script_runner': 'cloudify-script-plugin',
    'windows_agent_installer': 'cloudify-agent',
    'windows_plugin_installer': 'cloudify-agent',
    'worker_installer': 'cloudify-agent',
    'cloudify_system_workflows': 'cloudify-manager/workflows'

}

env_packages = {
    'amqpinflux': [
        'amqp_influxdb'
    ],
    'manager': [
        'cloudify',
        'cloudify_agent',
        'cloudify_handler',
        'cloudify_rest_client',
        'diamond_agent',
        'dsl_parser',
        'manager_rest',
        'plugin_installer',
        'script_runner',
        'windows_agent_installer',
        'windows_plugin_installer',
        'worker_installer',
    ],
    'mgmtworker': [
        'cloudify',
        'cloudify_agent',
        'cloudify_handler',
        'cloudify_system_workflows',
        'cloudify_rest_client',
        'diamond_agent',
        'dsl_parser',
        'plugin_installer',
        'script_runner',
        'windows_agent_installer',
        'windows_plugin_installer',
        'worker_installer',
    ]
}


class Synchronizer(object):

    def __init__(self, source_root):
        handler_configuration = cosmo.handler_configuration
        self.ip = handler_configuration['manager_ip']
        self.user = handler_configuration['manager_user']
        self.hoststring = '{}@{}'.format(self.user, self.ip)
        self.key = os.path.expanduser(handler_configuration['manager_key'])
        self.control_path = cosmo.dir / 'control'
        self.source_root = source_root
        self.ssh = bake(sh.ssh).bake(
            '-o', 'UserKnownHostsFile=/dev/null',<commit_msg>remove diamond plugin from sync<commit_after>#! /usr/bin/env claw
########
# Copyright (c) 2015 GigaSpaces Technologies Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#        http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
############

import os
import time

import sh

from claw import cosmo
from claw.commands import bake

package_dir = {
    'amqp_influxdb': 'cloudify-amqp-influxdb',
    'cloudify': 'cloudify-plugins-common',
    'cloudify_agent': 'cloudify-agent',
    'cloudify_rest_client': 'cloudify-rest-client',
    'dsl_parser': 'cloudify-dsl-parser',
    'manager_rest': 'cloudify-manager/rest-service',
    'plugin_installer': 'cloudify-agent',
    'script_runner': 'cloudify-script-plugin',
    'windows_agent_installer': 'cloudify-agent',
    'windows_plugin_installer': 'cloudify-agent',
    'worker_installer': 'cloudify-agent',
    'cloudify_system_workflows': 'cloudify-manager/workflows'

}

env_packages = {
    'amqpinflux': [
        'amqp_influxdb'
    ],
    'manager': [
        'cloudify',
        'cloudify_agent',
        'cloudify_rest_client',
        'dsl_parser',
        'manager_rest',
        'plugin_installer',
        'script_runner',
        'windows_agent_installer',
        'windows_plugin_installer',
        'worker_installer',
    ],
    'mgmtworker': [
        'cloudify',
        'cloudify_agent',
        'cloudify_system_workflows',
        'cloudify_rest_client',
        'dsl_parser',
        'plugin_installer',
        'script_runner',
        'windows_agent_installer',
        'windows_plugin_installer',
        'worker_installer',
    ]
}


class Synchronizer(object):

    def __init__(self, source_root):
        handler_configuration = cosmo.handler_configuration
        self.ip = handler_configuration['manager_ip']
        self.user = handler_configuration['manager_user']
        self.hoststring = '{}@{}'.format(self.user, self.ip)
        self.key = os.path.expanduser(handler_configuration['manager_key'])
        self.control_path = cosmo.dir / 'control'
        self.source_root = source_root
        self.ssh = bake(sh.ssh).bake(
            '-o', 'UserKnownHostsFile=/dev/null',
{'fraction_non_alphanumeric': 0.12147984538928769, 'fraction_numerical': 0.0029449659488312166, 'mean_word_length': 3.2753737214791503, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '865496', 'n_tokens_mistral': 1682, 'n_tokens_neox': 1638, 'n_words': 369}