Пример #1
0
def backup_many(csv_file, backup_type=None, **kwargs):
    # use Veritas to get valid rows
    rows = VeritasValidor.filter_valid_rows(csv_file)

    # create a new WP site backup for each row
    print("\n{} websites will now be backuped...".format(len(rows)))
    for index, row in rows:
        logging.debug("%s - row %s: %s", row["wp_site_url"], index, row)
        WPBackup(openshift_env=row["openshift_env"],
                 wp_site_url=row["wp_site_url"],
                 wp_default_site_title=row["wp_default_site_title"],
                 backup_type=backup_type).backup()
Пример #2
0
def generate_many(csv_file, **kwargs):
    # use Veritas to get valid rows
    rows = VeritasValidor.filter_valid_rows(csv_file)

    # create a new WP site for each row
    print("\n{} websites will now be generated...".format(len(rows)))
    for index, row in rows:
        print("\nIndex #{}:\n---".format(index))
        logging.debug("%s - row %s: %s", row["wp_site_url"], index, row)
        WPGenerator(
            row["openshift_env"],
            row["wp_site_url"],
            row["unit_name"],
            wp_default_site_title=row["wp_default_site_title"],
            unit_name=row["unit_name"],
            updates_automatic=row["updates_automatic"],
            installs_locked=row["installs_locked"],
            theme=row["theme"],
            theme_faculty=row["theme_faculty"],
        ).generate()
Пример #3
0
def test_filter_method():
    filename = os.path.join(CURRENT_DIR, TEST_FILE)
    valid_lines = (0, VALID_LINE)
    validator = VeritasValidor.filter_valid_rows(filename,
                                                 columns=MOCK_JAHIA2WP_COLUMNS)
    assert valid_lines[1] == validator[0][1]