示例#1
0
 def update_consumer(self, consumer_id, consumer_ref):
     with sql.session_for_write() as session:
         consumer = self._get_consumer(session, consumer_id)
         old_consumer_dict = consumer.to_dict()
         old_consumer_dict.update(consumer_ref)
         new_consumer = Consumer.from_dict(old_consumer_dict)
         consumer.description = new_consumer.description
         consumer.extra = new_consumer.extra
         return base.filter_consumer(consumer.to_dict())
示例#2
0
文件: sql.py 项目: ISCAS-VDI/keystone
 def update_consumer(self, consumer_id, consumer_ref):
     with sql.session_for_write() as session:
         consumer = self._get_consumer(session, consumer_id)
         old_consumer_dict = consumer.to_dict()
         old_consumer_dict.update(consumer_ref)
         new_consumer = Consumer.from_dict(old_consumer_dict)
         consumer.description = new_consumer.description
         consumer.extra = new_consumer.extra
     return base.filter_consumer(consumer.to_dict())
示例#3
0
文件: sql.py 项目: timeu/keystone
 def list_consumers(self):
     with sql.session_for_read() as session:
         cons = session.query(Consumer)
         return [base.filter_consumer(x.to_dict()) for x in cons]
示例#4
0
文件: sql.py 项目: timeu/keystone
 def get_consumer(self, consumer_id):
     return base.filter_consumer(self.get_consumer_with_secret(consumer_id))
示例#5
0
文件: sql.py 项目: ISCAS-VDI/keystone
 def get_consumer(self, consumer_id):
     return base.filter_consumer(
         self.get_consumer_with_secret(consumer_id))
示例#6
0
文件: sql.py 项目: ISCAS-VDI/keystone
 def list_consumers(self):
     with sql.session_for_read() as session:
         cons = session.query(Consumer)
         return [base.filter_consumer(x.to_dict()) for x in cons]