Beispiel #1
0
 def test_db(self, host_pre):
     if is_conn_to_db(host=host_pre,
                      db=self.fetch('postgres', 'database'),
                      port=str(self.fetch('postgres', 'port')),
                      user=self.fetch('postgres', 'user'),
                      paswd=self.fetch('postgres', 'password')):
         self.config.set('postgres', 'host', host_pre)
         self._apply_environ()
         return True
     return False
Beispiel #2
0
 def test_db(self, host_pre):
     if is_conn_to_db(host=host_pre,
                      db=self.args.dbname,
                      port=self.args.port,
                      user=self.args.username,
                      paswd=self.args.password):
         self.args.hostname = host_pre
         os.environ['PGHOST'] = self.args.hostname
         return True
     return False
Beispiel #3
0
 def test_db(self, host_pre):
     if is_conn_to_db(
         host=host_pre,
         db=self.fetch('postgres', 'database'),
         port=str(self.fetch('postgres', 'port')),
         user=self.fetch('postgres', 'user'),
             paswd=self.fetch('postgres', 'password')):
         self.config.set('postgres', 'host', host_pre)
         self._apply_environ()
         return True
     return False
Beispiel #4
0
 def test_db(self, host_pre):
     if is_conn_to_db(
         host=host_pre,
         db=self.args.dbname,
         port=self.args.port,
         user=self.args.username,
             paswd=self.args.password):
         self.args.hostname = host_pre
         os.environ['PGHOST'] = self.args.hostname
         return True
     return False
Beispiel #5
0
 def test_db(self, host_pre):
     logging.debug('Test host: {0}'.format(host_pre))
     if is_conn_to_db(host=host_pre,
                      db=self.args.dbname,
                      port=self.args.port,
                      user=self.args.username,
                      paswd=self.args.password):
         self.args.hostname = host_pre
         os.environ['PGHOST'] = self.args.hostname
         logging.debug('Connected via: {0}'.format(host_pre))
         return True
     return False
Beispiel #6
0
 def test_db(self, host_pre):
     logging.debug('Test host: {0}'.format(host_pre))
     if is_conn_to_db(
         host=host_pre,
         db=self.args.dbname,
         port=self.args.port,
         user=self.args.username,
             paswd=self.args.password):
         self.args.hostname = host_pre
         os.environ['PGHOST'] = self.args.hostname
         logging.debug('Connected via: {0}'.format(host_pre))
         return True
     return False