← Back to team overview

openerp-india team mailing list archive

[Bug 1149484] [NEW] [7.0] dump/restore cannot get db password from config file

 

Public bug reported:

There is code in lib/python2.7/site-packages/openerp-7.0-py2.7.egg/openerp/service/web_services.py:
    @contextlib.contextmanager
    def _set_pg_password_in_environment(self):
        """ On Win32, pg_dump (and pg_restore) require that
        :envvar:`PGPASSWORD` be set

        This context management method handles setting
        :envvar:`PGPASSWORD` iif win32 and the envvar is not already
        set, and removing it afterwards.
        """
        if os.name != 'nt' or os.environ.get('PGPASSWORD'):
            yield
        else:
            os.environ['PGPASSWORD'] = tools.config['db_password']
            try:
                yield
            finally:
                del os.environ['PGPASSWORD']

So, on linux machine it does not read db_password from config, and
dump/restore gives you Access Denied. Possible solution is to create
.pgpass file, but should not it work just with db_password in config?

** Affects: openobject-server
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Server.
https://bugs.launchpad.net/bugs/1149484

Title:
  [7.0] dump/restore cannot get db password from config file

Status in OpenERP Server:
  New

Bug description:
  There is code in lib/python2.7/site-packages/openerp-7.0-py2.7.egg/openerp/service/web_services.py:
      @contextlib.contextmanager
      def _set_pg_password_in_environment(self):
          """ On Win32, pg_dump (and pg_restore) require that
          :envvar:`PGPASSWORD` be set

          This context management method handles setting
          :envvar:`PGPASSWORD` iif win32 and the envvar is not already
          set, and removing it afterwards.
          """
          if os.name != 'nt' or os.environ.get('PGPASSWORD'):
              yield
          else:
              os.environ['PGPASSWORD'] = tools.config['db_password']
              try:
                  yield
              finally:
                  del os.environ['PGPASSWORD']

  So, on linux machine it does not read db_password from config, and
  dump/restore gives you Access Denied. Possible solution is to create
  .pgpass file, but should not it work just with db_password in config?

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/1149484/+subscriptions


Follow ups

References