示例#1
0
def manage_nuget_sources(config, params):
    check_if_all_params_specified(params, 'nuget_config_file', 'custom_source_directory', 'custom_source_name', 'template_file')

    config_file = get_param_value('nuget_config_file', params, config)
    directory = get_param_value('custom_source_directory', params, config)
    name = get_param_value('custom_source_name', params, config)
    template_file = get_param_value('template_file', params, config)

    print('Config file : {0}, directory : {1}, name : {2}'.format(config_file, directory, name))

    os.rename(config_file, config_file + '.orig')

    kwargs = {'source_name': name, 'source_directory': directory}
    create_and_full_fill_file(template_file, config_file, kwargs)
示例#2
0
def fulfill_file_template(config, params):
    check_if_all_params_specified(params, 'template', 'destination', 'ip', 'port', 'is_automated', 'is_remote',
                                  'format')

    template_file = get_param_value('template', params, config)
    destination = get_param_value('destination', params, config)
    ip = get_param_value('ip', params, config)
    port = get_param_value('port', params, config)
    is_automated = get_param_value('is_automated', params, config)
    is_remote = get_param_value('is_remote', params, config)
    format = get_param_value('format', params, config)


    # TODO: Add ip check due to that it could be closed

    kwargs = {'is_automated': is_automated.lower(), 'is_remote': is_remote.lower(), 'ip': ip, 'port': port,
              'format': format}
    create_and_full_fill_file(template_file, destination, kwargs)