Skip to content

Commit

Permalink
Merge pull request #8472 from apfeiffer1/listGTsForTag
Browse files Browse the repository at this point in the history
List GTs for a given tag in conddb
  • Loading branch information
cmsbuild committed Apr 14, 2015
2 parents 7599080 + 73ff738 commit 63046ac
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions CondCore/Utilities/scripts/conddb
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,19 @@ def listTags_(args):
)


def listGTsForTag_(args):
connection = connect(args)
session = connection.session()

output_table(args,
session.query(conddb.GlobalTagMap.global_tag_name, conddb.GlobalTagMap.tag_name, conddb.GlobalTagMap.record, conddb.GlobalTagMap.label).\
filter(conddb.GlobalTagMap.tag_name == args.name).\
order_by(conddb.GlobalTagMap.global_tag_name).\
all(),
['GT_name', 'Tag_name', 'record', 'label'],
)


def listGTs_(args):
connection = connect(args)
session = connection.session()
Expand Down Expand Up @@ -1324,6 +1337,10 @@ def main():
parser_listTags = parser_subparsers.add_parser('listTags', description='Lists all the Tags available in the DB.')
parser_listTags.set_defaults(func=listTags_)

parser_listGTsForTag = parser_subparsers.add_parser('listGTsForTag', description='Lists the GTs which contain a given tag.')
parser_listGTsForTag.add_argument('name', help="Name of the tag.")
parser_listGTsForTag.set_defaults(func=listGTsForTag_)

parser_listGTs = parser_subparsers.add_parser('listGTs', description='Lists the GTs available in the DB.')
parser_listGTs.set_defaults(func=listGTs_)

Expand Down

0 comments on commit 63046ac

Please sign in to comment.