gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] Does bootstrapping / upgrading databases sometimes ne


From: Jim Busser
Subject: Re: [Gnumed-devel] Does bootstrapping / upgrading databases sometimes need mxDateTime ?
Date: Sun, 31 Jul 2011 02:11:36 -0700

On 2011-07-31, at 1:03 AM, Sebastian Hilbert wrote:

I cannot think of a reason why that would matter. It does for psycopg2 but not for mxDateTime as far as I know. I believe the bootstrap script tries to pick the wrong python installation.

I think I figured it out below, it may just be that the inability to find mx.DateTime was a symptom of a still-broken (and since-repaired) symlink.

It did seem from the successful log for [...]/bootstrap/update_db-v15_v16.log that it wanted to look for both psycopg2 and mx (whether or not they were needed):

2011-07-30 12:24:23  CRITICAL  gm.logging (/usr/local/git/gnumed/gnumed/gnumed/Gnumed/pycommon/gmLog2.py::__setup_logging() #229): -------- start of logging ------------------------------
2011-07-30 12:24:23  INFO      gm.logging (/usr/local/git/gnumed/gnumed/gnumed/Gnumed/pycommon/gmLog2.py::__setup_logging() #230): log file is </usr/local/git/gnumed/gnumed/gnumed/server/bootstrap/update_db-v15_v16.log>
2011-07-30 12:24:23  INFO      gm.logging (/usr/local/git/gnumed/gnumed/gnumed/Gnumed/pycommon/gmLog2.py::__setup_logging() #231): log level is [DEBUG]
2011-07-30 12:24:23  INFO      gm.logging (/usr/local/git/gnumed/gnumed/gnumed/Gnumed/pycommon/gmLog2.py::__setup_logging() #232): log file encoding is <utf8>
2011-07-30 12:24:23  INFO      gm.logging (/usr/local/git/gnumed/gnumed/gnumed/Gnumed/pycommon/gmLog2.py::__setup_logging() #233): initial python.str -> python.unicode encoding is <US-ASCII>
2011-07-30 12:24:23  INFO      gm.cfg (/usr/local/git/gnumed/gnumed/gnumed/Gnumed/pycommon/gmCfg2.py::<module>() #19): $Revision: 1.20 $
2011-07-30 12:24:24  INFO      gm.db (/usr/local/git/gnumed/gnumed/gnumed/Gnumed/pycommon/gmLoginInfo.py::<module>() #13): $Revision: 1.17 $
2011-07-30 12:24:24  INFO      gm.i18n (/usr/local/git/gnumed/gnumed/gnumed/Gnumed/pycommon/gmI18N.py::<module>() #61): $Revision: 1.50 $
2011-07-30 12:24:24  INFO      gm.datetime (/usr/local/git/gnumed/gnumed/gnumed/Gnumed/pycommon/gmDateTime.py::<module>() #60): $Revision: 1.34 $
2011-07-30 12:24:24  INFO      gm.datetime (/usr/local/git/gnumed/gnumed/gnumed/Gnumed/pycommon/gmDateTime.py::<module>() #61): mx.DateTime version: 3.1.2
2011-07-30 12:24:24  INFO      gm.db (/usr/local/git/gnumed/gnumed/gnumed/Gnumed/pycommon/gmPG2.py::<module>() #30): $Revision: 1.127 $
2011-07-30 12:24:24  INFO      gm.db (/usr/local/git/gnumed/gnumed/gnumed/Gnumed/pycommon/gmPG2.py::<module>() #43): psycopg2 version: 2.4 (dt dec pq3 ext)
2011-07-30 12:24:24  INFO      gm.db (/usr/local/git/gnumed/gnumed/gnumed/Gnumed/pycommon/gmPG2.py::<module>() #44): PostgreSQL via DB-API module "<module 'psycopg2' from '/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/psycopg2/__init__.pyc'>": API level 2.0, thread safety 2, parameter style "pyformat"
2011-07-30 12:24:24  DEBUG     psycopg2 (/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/psycopg2/pool.py::<module>() #39): installed. Logging using Python logging module
<SNIP>

You can try to find out which (in which directory) python is called by the upgrade script.

python is being called from

~/git/gnumed/gnumed/gnumed/server/bootstrap/upgrade-db.sh

which has

#!/usr/bin/env python

and if I call

MacBook-2:~ djb$ /usr/bin/env python
Python 2.6.6 (r266:84292, May  6 2011, 12:27:00) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()

vs if I call

MacBook-2:~ djb$ python
Python 2.6.6 (r266:84292, May  6 2011, 12:27:00) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 

they look the same, and if I query the os which python

MacBook-2:~ djb$ which python
/opt/local/bin/python

that shouldn't have been a function of the path to psql (EnterpriseDb vs MacPorts postgres binaries), and a broken symlink Gnumed would have failed

from Gnumed.pycommon import gmLog2

so maybe it was actually my fixing that symlink (and not my postgres binaries path) that mattered. FWIW I checked the rest, wrt which python importing mx.DateTime

MacBook-2:~ djb$  sudo port install python_select
Password:
--->  Fetching python_select
--->  Verifying checksum(s) for python_select
--->  Extracting python_select
--->  Configuring python_select
--->  Building python_select
--->  Staging python_select into destroot
--->  Installing python_select @0.3_1
--->  Activating python_select @0.3_1
--->  Cleaning python_select

MacBook-2:~ djb$ port select --list python
Available versions for python:
none
python25-apple
python26 (active)
python26-apple
python27

Then manually start that python binary and try
import mx.DateTime

MacBook-2:~ djb$ python
Python 2.6.6 (r266:84292, May  6 2011, 12:27:00) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import mx.DateTime
>>> from mx.DateTime import now
>>> now()
<mx.DateTime.DateTime object for '2011-07-31 01:22:37.97' at 100530c38>
>>>

-- Jim


reply via email to

[Prev in Thread] Current Thread [Next in Thread]