'Adds the DAG into the bag, recurses into sub dags.'

def bag_dag(self, dag, parent_dag, root_dag):

    self.dags[dag.dag_id] = dag
    dag.resolve_template_files()
    dag.last_loaded = datetime.now()
    for task in dag.tasks:
        settings.policy(task)
    for subdag in dag.subdags:
        subdag.full_filepath = dag.full_filepath
        subdag.parent_dag = dag
        subdag.is_subdag = True
        self.bag_dag(subdag, parent_dag=dag, root_dag=root_dag)
    self.logger.debug(u'Loaded    DAG    {dag}'.format(**locals()))
