This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from reana_db.models import User, Workflow | |
from reana_db.database import Session | |
email = "[email protected]" | |
me = User.query.filter_by(email=email).one() | |
for wf in me.workflows: | |
for wr in wf.resources: | |
Session.delete(wr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kubernetes import client | |
from kubernetes import config as k8s_config | |
k8s_config.load_incluster_config() | |
api_configuration = client.Configuration() | |
api_configuration.verify_ssl = False | |
api_client = client.CoreV1Api() | |
api_client.list_node() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import os | |
from getpass import getpass | |
from reana_client.api.client import ( | |
create_workflow_from_json, | |
get_workflow_status, | |
ping, | |
start_workflow, | |
upload_to_server, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# $ git clone inveniosoftware/automation_tools | |
# $ cd automation_tools | |
# $ ipython | |
from automation_tools.repositories import GithubUtils | |
GITHUB_INVENIOSOFTWARE_URL = "https://github.com/inveniosoftware/" | |
GA_INVENIOSOFTWARE_BADGE_URL = GITHUB_INVENIOSOFTWARE_URL + "{}/workflows/CI/badge.svg" | |
inveniosoftware_repos = GithubUtils.list_organization_repositories('inveniosoftware') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
payment_settings.set('currencies', payment_settings.get('currencies') + [{u'code': u'AUD', u'name': u'Australian Dollar'}]) | |
db.session.commit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from indico.core.db import db | |
from terminaltables import AsciiTable | |
db.session.execute(''' | |
INSERT INTO events.requests (event_id, type, state, data, created_by_id, created_dt) | |
SELECT | |
rvl.linked_event_id, | |
'vc-assistance', | |
1, | |
json_build_object('comment', ''), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.session.add(RoomAttribute(name="long-term", title="Long term", is_hidden=True)) | |
ra = RoomAttribute.query.filter_by(name='long-term').one() # Burotel | |
for r in Room.query.order_by(Room.id.asc()).limit(100): | |
RoomAttributeAssociation(room=r, attribute=ra, value='true') | |
db.session.commit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def upgrade(): | |
op.create_table( | |
'reservation_links', | |
sa.Column('id', sa.Integer(), nullable=False), | |
sa.Column('event_id', sa.Integer(), nullable=True, index=True), | |
sa.Column('linked_event_id', sa.Integer(), nullable=True, index=True), | |
sa.Column('contribution_id', sa.Integer(), nullable=True, index=True), | |
sa.Column('session_block_id', sa.Integer(), nullable=True, index=True), | |
sa.Column('link_type', | |
PyIntEnum(LinkType, exclude_values={LinkType.category, LinkType.subcontribution, LinkType.session}), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- upgrade | |
WITH reserv_data AS ( | |
SELECT nextval('roombooking.reservation_links_id_seq') AS new_link_id, id AS reserv_id, event_id | |
FROM roombooking.reservations | |
WHERE event_id IS NOT NULL | |
-- LIMIT 2 | |
), link_ids_data AS ( | |
INSERT INTO roombooking.reservation_links (id, event_id, linked_event_id, link_type) | |
SELECT new_link_id, event_id, event_id, 2 -- LinkType.event |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH reserv_data AS ( | |
SELECT nextval('roombooking.reservation_links_id_seq') AS new_link_id, id AS reserv_id, event_id | |
FROM roombooking.reservations | |
WHERE event_id IS NOT NULL | |
-- LIMIT 2 | |
), link_ids_data AS ( | |
INSERT INTO roombooking.reservation_links (id, event_id, linked_event_id, link_type) | |
SELECT new_link_id, event_id, event_id, 2 -- LinkType.event | |
FROM reserv_data | |
RETURNING id AS link_id |
NewerOlder