Esempio n. 1
0
 def _to_disk(self, element):
     disk = Disk(id=element['id'],
                 state=NODE_STATE_MAP.get(element['state'],
                                          NodeState.UNKNOWN),
                 name=element['name'],
                 driver=self.connection.driver,
                 size=element['size'],
                 extra={'can_snapshot': element['can_snapshot']})
     return disk
Esempio n. 2
0
 def _to_disk(self, element):
     disk = Disk(
         id=element["id"],
         state=NODE_STATE_MAP.get(element["state"], NodeState.UNKNOWN),
         name=element["name"],
         driver=self.connection.driver,
         size=element["size"],
         extra={"can_snapshot": element["can_snapshot"]},
     )
     return disk