Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-18 22:30:25

0001 // -*- C++ -*-
0002 //
0003 // Package:     Utilities
0004 // Class  :     cmsGetFnConnect
0005 //
0006 // Implementation:
0007 //     Looks up a frontier connect string
0008 //
0009 // Original Author:  Dave Dykstra
0010 //         Created:  Tue Feb 22 16:54:06 CST 2011
0011 //
0012 
0013 #include "FWCore/Catalog/interface/SiteLocalConfig.h"
0014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0015 #include "FWCore/ServiceRegistry/interface/Service.h"
0016 #include "FWCore/Services/interface/setupSiteLocalConfig.h"
0017 #include "FWCore/Utilities/interface/Exception.h"
0018 #include <iostream>
0019 #include <cstring>
0020 #include <memory>
0021 
0022 int main(int argc, char* argv[]) {
0023   if ((argc != 2) || (strncmp(argv[1], "frontier://", 11) != 0)) {
0024     std::cerr << "Usage: cmsGetFnConnect frontier://shortname" << std::endl;
0025     return 2;
0026   }
0027 
0028   try {
0029     auto operate = edm::setupSiteLocalConfig();
0030 
0031     edm::Service<edm::SiteLocalConfig> localconfservice;
0032 
0033     std::cout << localconfservice->lookupCalibConnect(argv[1]) << std::endl;
0034   } catch (cms::Exception const& e) {
0035     std::cerr << e.explainSelf() << std::endl;
0036     return 2;
0037   }
0038   return 0;
0039 }