def create_session(self):
"""
Creates a session and get some details on the machine.
"""
self.session = requests.Session()
self.session.auth = self.auth
# whether verify the SSL certificate or not
self.session.verify = self.ca_cert or False
if self.disable_warnings:
requests.packages.urllib3.disable_warnings()
if self.web_service == 'rpc':
self.session.cookies = requests.cookies.cookiejar_from_dict(
self._xml_rpc_auth())
else:
# cookie workaround - consider changing with _get_last_activity()
self.list_systems(limit=1)
self.details = self.get_system_details()
评论列表
文章目录