Remove unnecessary mount properties

This commit is contained in:
Einar Forselv 2019-04-14 20:55:35 +02:00
parent 12a1b3d97e
commit 6d896757b7
1 changed files with 6 additions and 18 deletions

View File

@ -52,7 +52,7 @@ class Container:
class Mount: class Mount:
"""Mount wrapper""" """Mount wrapper"""
def __init__(self, data, container=None): def __init__(self, data, container=None):
self.data = data self._data = data
self._container = container self._container = container
@property @property
@ -61,31 +61,19 @@ class Mount:
@property @property
def type(self): def type(self):
return self.data.get('Type') return self._data.get('Type')
@property @property
def name(self): def name(self):
return self.data.get('Name') return self._data.get('Name')
@property @property
def source(self): def source(self):
return self.data.get('Source') return self._data.get('Source')
@property @property
def destination(self): def destination(self):
return self.data.get('Destination') return self._data.get('Destination')
@property
def driver(self):
return self.data.get('Driver')
@property
def mode(self):
return self.data.get('Mode')
@property
def rw(self):
return self.data.get('RW')
def mount_string(self): def mount_string(self):
if self.type == VOLUME_TYPE_VOLUME: if self.type == VOLUME_TYPE_VOLUME:
@ -99,7 +87,7 @@ class Mount:
return str(self) return str(self)
def __str__(self): def __str__(self):
return str(self.data) return str(self._data)
def __hash__(self): def __hash__(self):
"""Uniquness for a volume""" """Uniquness for a volume"""