test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
iovs_test.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 import pprint
4 import datetime
5 import sys
6 
7 if __name__ == "__main__":
8  # this class should extend a framework base class that
9  # provides default implementations of important methods
10  import sys
11  sys.path.append("../")
12  from CondCore.Utilities.CondDBFW import querying_framework_api
13  import CondCore.Utilities.CondDBFW.data_sources, CondCore.Utilities.CondDBFW.data_formats as format
14  from CondCore.Utilities.CondDBFW.querying import connect
15 
16  class query_script():
17 
18  def script(self, connection):
19  tag = connection.tag(name=sys.argv[1])
20  iovs = tag.iovs(pretty=True)
21  return iovs
22 
23  secrets_file = "/afs/cern.ch/cms/DB/conddb/.cms_cond/netrc"
24  secrets_file_1 = "netrc_test"
25 
26  connection_data = {"db_alias" : "orapro", "schema" : "cms_conditions", "host" : "oracle", "secrets" : secrets_file}
27  qf = querying_framework_api(connection_data)
28  data = qf.run_script(query_script())
29 
30  data.as_table(columns=["since", "payload_hash", "insertion_time"], fit=["all"])