def __build_scheduler_json__(self):
     self.result_dict[KEY_TASK_ID] = self.scheduler.id
     self.result_dict[KEY_SOURCE_ENV] = EnvironmentBuilder(
         environment=self.scheduler.source_environment).get_data()
     self.result_dict[KEY_TARGET_ENV] = EnvironmentBuilder(
         environment=self.scheduler.target_environment).get_data()
     self.result_dict[KEY_COUNTRY_LIST] = self.get_country_list()
     self.result_dict[ACTION_LIST] = self.get_action_list()
     self.result_dict[KEY_RECEIVER_LIST] = self.get_mail_list()
     self.result_dict[KEY_CREATOR] = UserBuilder(
         self.scheduler.creator).get_data()
     self.result_dict[KEY_EDITOR] = UserBuilder(
         self.scheduler.editor).get_data()
     self.result_dict[KEY_FREQUENCY_TYPE] = FrequencyTypeBuilder(
         self.scheduler.frequency_type).get_data()
     self.result_dict[KEY_INTERVAL] = self.scheduler.interval
     self.result_dict[KEY_CREATED_TIME] = self.get_format_time(
         self.scheduler.created_time)
     self.result_dict[KEY_UPDATED_TIME] = self.get_format_time(
         self.scheduler.updated_time)
     self.result_dict[KEY_LAST_PROCEED_TIME] = self.get_format_time(
         self.scheduler.last_proceed_time)
     self.result_dict[KEY_NEXT_PROCEED_TIME] = self.get_format_time(
         self.scheduler.next_proceed_time)
     self.result_dict[KEY_ENABLE] = bool(self.scheduler.enable)
 def get_report_data(self):
     self.result_dict["left_data_center"] = FTPRegionBuilder(
         region=self.scheduler.left_data_center).get_data()
     self.result_dict["right_data_center"] = FTPRegionBuilder(
         region=self.scheduler.right_data_center).get_data()
     self.result_dict["left_environment"] = EnvironmentBuilder(
         environment=self.scheduler.left_environment).get_data()
     self.result_dict["right_environment"] = EnvironmentBuilder(
         environment=self.scheduler.right_environment).get_data()
     self.result_dict["left_folder"] = self.scheduler.left_folder
     self.result_dict["right_folder"] = self.scheduler.right_folder
     return self.result_dict
Beispiel #3
0
 def __generate_data__(self):
     self.result_dict[KEY_ENVIRONMENT] = EnvironmentBuilder(
         environment=self.environment).get_data()
     self.result_dict[KEY_COUNTRY] = CountryBuilder(self.country).get_data()
     self.result_dict[KEY_RULESET_NAME] = self.ruleset_name
     self.result_dict[KEY_RULESET_DATA] = self.ruleset_list
     self.result_dict[KEY_RULESET_PATH_INFO] = self.ruleset_path_info
 def parse_environment(self):
     environment_list = []
     for object in self.environments:
         environment_data = EnvironmentBuilder(
             id=object.get(KEY_ID)).get_data()
         environment_list.append(environment_data)
     return environment_list
 def __generate_data__(self):
     self.result_dict[KEY_LEFT_ENVIRONMENT] = EnvironmentBuilder(
         environment=self.left_root_object.environment).get_data()
     self.result_dict[KEY_RIGHT_ENVIRONMENT] = EnvironmentBuilder(
         environment=self.right_root_object.environment).get_data()
     self.result_dict[KEY_LEFT_REGION] = FTPRegionBuilder(
         id=self.left_root_object.region_id).get_data()
     self.result_dict[KEY_RIGHT_REGION] = FTPRegionBuilder(
         id=self.right_root_object.region_id).get_data()
     self.result_dict[KEY_LEFT_FOLDER] = self.left_root_object.folder
     self.result_dict[KEY_RIGHT_FOLDER] = self.right_root_object.folder
     self.result_dict[KEY_COMPARE_HASH_KEY] = self.compare_key
     self.result_dict[KEY_LEFT_ONLY_DATA] = self.left_only_list
     self.result_dict[KEY_RIGHT_ONLY_DATA] = self.right_only_list
     self.result_dict[KEY_DIFFERENT] = self.different_list
     self.result_dict[KEY_HAS_CHANGES] = self.has_changes
Beispiel #6
0
 def parse_role_permission_objects(self):
     try:
         data_object = {KEY_ENVIRONMENT: EnvironmentBuilder(id=self.environment_id).get_data(),
                        KEY_FUNCTION_ROLE_PERMISSION: self.parse_function_role_permission_array(self.environment_id)}
         return data_object
     except Exception as e:
         error_log(e)
         traceback.format_exc()
    def get_report_data(self):
        self.result_dict[BASE_ENVIRONMENT] = EnvironmentBuilder(
            environment=self.scheduler.base_environment).get_data()
        self.result_dict[COMPARE_ENVIRONMENT] = EnvironmentBuilder(
            environment=self.scheduler.compare_environment).get_data()
        self.result_dict[KEY_MODULE_DATA] = ModuleBuilder(
            self.scheduler.module).get_data()
        self.result_dict[KEY_COUNTRY_LIST] = CountriesBuilder(
            countries=self.countries).get_data()
        self.result_dict[RULESET_MAIL_CONTENT_TYPE] = MailContentTypesBuilder(
            self.mail_content_types).get_data()
        self.result_dict[KEY_DISPLAY_NAME] = self.get_display_name()
        self.result_dict[
            KEY_SKIP_RULESETS] = ReportSchedulerSkipRulesetsBuilder(
                self.skip_rulesets).get_data()

        return self.result_dict
 def __generate_data__(self):
     self.result_dict[KEY_ENVIRONMENT] = EnvironmentBuilder(
         environment=self.root_object.environment).get_data()
     self.result_dict[KEY_REGION] = FTPRegionBuilder(
         id=self.root_object.region_id).get_data()
     self.result_dict[KEY_FOLDER] = self.root_object.folder
     self.result_dict[
         KEY_COMPARE_HASH_KEY] = self.root_object.dir_connect_obj.root_hash_key
     self.result_dict[KEY_DATA] = self.result_file_list
Beispiel #9
0
 def __generate_data__(self):
     self.result_dict[KEY_TARGET_ENV] = EnvironmentBuilder(
         environment=self.target_env).get_data()
     self.result_dict[KEY_COUNTRY] = CountryBuilder(self.country).get_data()
     self.result_dict[KEY_UPDATED_TIME] = self.get_current_time()
     self.result_dict[KEY_FAILED_RULESETS] = self.failed_rulesets_list
     self.result_dict[KEY_CREATED_RULESETS] = self.created_ruleset_list
     self.result_dict[KEY_UPDATED_RULESETS] = self.updated_ruleset_list
     self.result_dict[KEY_DELETED_RULESETS] = self.deleted_ruleset_list
 def __generate_data__(self):
     self.result_dict[KEY_LEFT_ENVIRONMENT] = EnvironmentBuilder(
         environment=self.left_root_object.environment).get_data()
     self.result_dict[KEY_RIGHT_ENVIRONMENT] = EnvironmentBuilder(
         environment=self.right_root_object.environment).get_data()
     self.result_dict[KEY_LEFT_REGION] = FTPRegionBuilder(
         id=self.left_root_object.region_id).get_data()
     self.result_dict[KEY_RIGHT_REGION] = FTPRegionBuilder(
         id=self.right_root_object.region_id).get_data()
     self.result_dict[KEY_LEFT_FOLDER] = self.left_root_object.folder
     self.result_dict[KEY_RIGHT_FOLDER] = self.right_root_object.folder
     self.result_dict[
         KEY_LEFT_DIFF_RESULT] = self.left_root_object.generate_compare_result_json(
         )
     self.result_dict[
         KEY_RIGHT_DIFF_RESULT] = self.right_root_object.generate_compare_result_json(
         )
     self.result_dict[KEY_COMPARE_HASH_KEY] = self.compare_key
    def parser_data(self):
        data_array = []
        environments = Environment.objects.all()
        for environment in environments:
            data_object = {KEY_ENVIRONMENT: EnvironmentBuilder(environment=environment).get_data(),
                           KEY_ROLE_TYPE: self.parse_role_type_array(environment.id)}

            data_array.append(data_object)
        data = {
            KEY_USER_DATA: UserBuilder(self.edit_user).get_data(),
            KEY_ENVIRONMENT_ROLE: data_array
        }
        return data
Beispiel #12
0
    def get_environments(self):
        env_id_list = []
        env_data_list = []
        source_environment_ids = RulesetLogGroup.objects.filter(
            updated__gt=0,
            source_environment_id__in=self.enable_environment_ids).values_list(
                "source_environment").distinct()
        target_environment_ids = RulesetLogGroup.objects.filter(
            updated__gt=0,
            target_environment__in=self.enable_environment_ids).values_list(
                "target_environment").distinct()
        env_id_list = self.get_distinct_environment_id(env_id_list,
                                                       source_environment_ids)
        env_id_list = self.get_distinct_environment_id(env_id_list,
                                                       target_environment_ids)

        for env_obj in env_id_list:
            env_data = EnvironmentBuilder(id=env_obj[0]).get_data()
            env_data_list.append(env_data)

        return env_data_list
 def __generate_data__(self):
     self.result_dict[KEY_COUNTRY] = CountryBuilder(self.country).get_data()
     self.result_dict[KEY_ENVIRONMENT] = EnvironmentBuilder(
         environment=self.environment).get_data()
     self.result_dict[RULE_NAME_LIST] = array_filter(
         self.ruleset_name_list, self.filter_keys)
Beispiel #14
0
 def parse_environment(environment_id):
     return EnvironmentBuilder(id=environment_id).get_data()