예제 #1
0
 def read_config(self, option):
     if self.config_filename is None:
         self.config_filename = self.generate_config_filename()
     parser = ConfigParser()
     parser.read(self.config_filename)
     try:
         option = parser.get(section='auth', option=option)
     except NoSectionError:
         raise AMaaSException('Invalid AMaaS config file')
     return option
예제 #2
0
 def patch(self, url, data=None, **kwargs):
     # Add a refresh
     if self.last_authenticated and not self.needs_refresh():
         return self.session.patch(url=url, data=data, **kwargs)
     else:
         raise AMaaSException('Not Authenticated')
예제 #3
0
 def get(self, url, **kwargs):
     # Add a refresh
     if self.last_authenticated and not self.needs_refresh():
         return self.session.get(url=url, **kwargs)
     else:
         raise AMaaSException('Not Authenticated')