# Path: cloudify_agent/tests/utils.py
# def create_agent_package(directory, config, package_logger=None):
#     if package_logger is None:
#         package_logger = logger
#     package_logger.info('Changing directory into {0}'.format(directory))
#     original = os.getcwd()
#     try:
#         package_logger.info('Creating Agent Package')
#         os.chdir(directory)
#         if platform.system() == 'Linux':
#             packager.create(config=config,
#                             config_file=None,
#                             force=False,
#                             verbose=False)
#             distname, _, distid = platform.dist()
#             return '{0}-{1}-agent.tar.gz'.format(distname, distid)
#         elif platform.system() == 'Windows':
#             create_windows_installer(config, logger)
#             return 'cloudify-windows-agent-{}.exe'.format(get_agent_version())
#         else:
#             raise NonRecoverableError('Platform not supported: {0}'
#                                       .format(platform.system()))
#     finally:
#         os.chdir(original)
# 
# def get_requirements_uri():
#     return os.path.join(get_source_uri(), 'dev-requirements.txt')
# 
# def get_source_uri():
#     return os.path.dirname(os.path.dirname(cloudify_agent.__file__))


import os
import sys
from cloudify_agent.tests.utils import (
    create_agent_package,
    get_requirements_uri,
    get_source_uri,
)
    from configparser import RawConfigParser
    from ConfigParser import RawConfigParser


try:
except ImportError:
    # py2


class AgentPackageGenerator(object):
    def __init__(self, file_server):
        self.initialized = False
        self._fs = file_server

    def _initialize(self):
        config = RawConfigParser()
        config.add_section('install')
        config.set('install', 'cloudify_agent_module', get_source_uri())
        config.set('install', 'requirements_file',

# Path: cloudify_agent/tests/utils.py
# def create_agent_package(directory, config, package_logger=None):
#     if package_logger is None:
#         package_logger = logger
#     package_logger.info('Changing directory into {0}'.format(directory))
#     original = os.getcwd()
#     try:
#         package_logger.info('Creating Agent Package')
#         os.chdir(directory)
#         if platform.system() == 'Linux':
#             packager.create(config=config,
#                             config_file=None,
#                             force=False,
#                             verbose=False)
#             distname, _, distid = platform.dist()
#             return '{0}-{1}-agent.tar.gz'.format(distname, distid)
#         elif platform.system() == 'Windows':
#             create_windows_installer(config, logger)
#             return 'cloudify-windows-agent-{}.exe'.format(get_agent_version())
#         else:
#             raise NonRecoverableError('Platform not supported: {0}'
#                                       .format(platform.system()))
#     finally:
#         os.chdir(original)
# 
# def get_requirements_uri():
#     return os.path.join(get_source_uri(), 'dev-requirements.txt')
# 
# def get_source_uri():
#     return os.path.dirname(os.path.dirname(cloudify_agent.__file__))


# Path: cloudify_agent/tests/agent_package_generator.py
import os
import sys
from cloudify_agent.tests.utils import (
    create_agent_package,
    get_requirements_uri,
    get_source_uri,
)
    from configparser import RawConfigParser
    from ConfigParser import RawConfigParser



try:
except ImportError:
    # py2


class AgentPackageGenerator(object):
    def __init__(self, file_server):
        self.initialized = False
        self._fs = file_server

    def _initialize(self):
        config = RawConfigParser()
        config.add_section('install')
        config.set('install', 'cloudify_agent_module', get_source_uri())
        config.set('install', 'requirements_file',

                   get_requirements_uri())