+ self.inspector_url = args.inspector_url
+ self.inspector_type = args.inspector_type
+ self.ip_addr = args.ip or socket.gethostbyname(self.hostname)
+
+ if self.inspector_type == 'congress':
+ auth = v2.Password(auth_url=os.environ['OS_AUTH_URL'],
+ username=os.environ['OS_USERNAME'],
+ password=os.environ['OS_PASSWORD'],
+ tenant_name=os.environ['OS_TENANT_NAME'])
+ self.session = ksc_session.Session(auth=auth)
+
+ congress = client.Client(session=self.session, service_type='policy')
+ ds = congress.list_datasources()['results']
+ doctor_ds = next((item for item in ds if item['driver'] == 'doctor'),
+ None)
+
+ congress_endpoint = congress.httpclient.get_endpoint(auth=auth)
+ self.inspector_url = ('%s/v1/data-sources/%s/tables/events/rows' %
+ (congress_endpoint, doctor_ds['id']))