def build_network_tree(): utils = Utils(dbhost=os.environ.get('POSTGRES_HOST')) utils.build_live_network_aci_tree()
import sys import os from airflow.models import DAG from airflow.operators.bash_operator import BashOperator from airflow.operators.python_operator import PythonOperator from airflow.operators.python_operator import BranchPythonOperator from airflow.operators.dummy_operator import DummyOperator from airflow.operators.subdag_operator import SubDagOperator from cm_sub_dag_import_huawei_gexport_files import import_huawei_gexport_parsed_csv sys.path.append('/mediation/packages') from bts import NetworkBaseLine, Utils, ProcessCMData bts_utils = Utils() def parse_and_import_huawei_gexport(parent_dag_name, child_dag_name, start_date, schedule_interval): dag_id = '%s.%s' % (parent_dag_name, child_dag_name) dag = DAG( '%s.%s' % (parent_dag_name, child_dag_name), schedule_interval=schedule_interval, start_date=start_date, ) task_clean_mo_names = BashOperator(task_id='clean_gexport_mo_names', bash_command=r""" sed -i -r "
from sqlalchemy import create_engine, MetaData, Table from sqlalchemy.orm import sessionmaker from sqlalchemy.sql import text from cm_sub_dag_parse_and_import_eri_3g4g import parse_and_import_eri_3g4g from cm_sub_dag_parse_and_import_eri_2g import parse_and_import_eri_2g from cm_sub_dag_parse_and_import_huawei_2g import parse_and_import_huawei_2g from cm_sub_dag_parse_and_import_huawei_3g import parse_and_import_huawei_3g from cm_sub_dag_parse_and_import_huawei_4g import parse_and_import_huawei_4g from airflow.utils.trigger_rule import TriggerRule sys.path.append('/mediation/packages') from bts import NetworkBaseLine, Utils, ProcessCMData bts_utils = Utils() schedule_interval = bts_utils.get_setting('cm_dag_schedule_interval') args = { 'owner': 'bodastage', 'depends_on_past': False, 'start_date': datetime(2017, 1, 1), 'email': ['*****@*****.**'], 'email_on_failure': False, 'email_on_retry': False, 'retries': 1, 'retry_delay': timedelta(minutes=5), } dag = DAG(dag_id='cm_etlp',