Improvise the pgsql driver to keep the utility names used for different

operation like backup, restore, etc within it.

Also:
* improvised the color combination of the background process logger.
* Removed an unnecessary print statement from the
  get_storage_directory(..) function, also return None if STORAGE_DIR
  is set to None.
This commit is contained in:
Ashesh Vashi
2016-05-14 00:48:11 +05:30
parent 5348f6e96a
commit b22d73ec46
4 changed files with 41 additions and 11 deletions

View File

@@ -335,6 +335,7 @@ WHERE
for st in kwargs['server_types']:
if st.instanceOf(mgr.ver):
mgr.server_type = st.stype
mgr.server_cls = st
break
mgr.update_session()
@@ -1017,6 +1018,7 @@ class ServerManager(object):
self.ver = None
self.sversion = None
self.server_type = None
self.server_cls = None
self.password = None
self.sid = server.id
@@ -1188,6 +1190,7 @@ WHERE db.oid = {0}""".format(did))
self.ver = None
self.sversion = None
self.server_type = None
self.server_cls = None
self.password = None
self.update_session()
@@ -1203,6 +1206,7 @@ WHERE db.oid = {0}""".format(did))
self.ver = None
self.sversion = None
self.server_type = None
self.server_cls = None
self.password = None
self.update_session()
@@ -1221,6 +1225,18 @@ WHERE db.oid = {0}""".format(did))
managers[self.sid] = updated_mgr
session['__pgsql_server_managers'] = managers
def utility(self, operation):
"""
utility(operation)
Returns: name of the utility which used for the operation
"""
if self.server_cls is not None:
return self.server_cls.utility(operation, self.sversion)
return None
class Driver(BaseDriver):
"""