Geoffroy,

You can set DB_TYPE to any value in in /etc/oscar/oscar.conf, it won't be read:
Here is the code responsible of this (from ConfigManager.pm lines 96 and 
followings.)
    # Load configuration values
    $rapt_path          = $config->get('RAPT_PATH');
    $yume_path          = $config->get('YUME_PATH');
    $prereqs_path       = $config->get('PREREQS_PATH');
    $packman_path       = $config->get('PREREQS_PATH') . "/packman";
    $nioscar            = $config->get('OSCAR_NETWORK_INTERFACE');
    $oscarbinaries_path = $config->get('OSCAR_SCRIPTS_PATH');
    $db_type            = $config->get('ODA_TYPE');
    $prereq_mode        = $config->get('PREREQ_MODE');
    $oda_files_path     = $config->get('PATH_ODA_CONFIG_FILES');
    $opkgs_path         = $config->get('OPKGS_PATH');

ODA_TYPE variable from oscar.conf can be set to file or db. In no way you can 
set it up to mysql (as the code is doing if(.... eq "db"))
DB_TYPE from oscar.conf can contain "mysql" and other values, but it is not 
read at all. Just look at the code.
that's why mysql is hardcoded when code is dealing with database.

It looks like $db_type = $config->get('DB_TYPE'); has been replaced by $db_type 
= $config->get('ODA_TYPE'); leading to ignore DB_TYPE.

While I can understand your position, I though that it was a good oportunity to 
stabilize the code and clean it up so it is easier to fix issues.
The actual code is cripled with tons of if(file) elif(db), and in the db side, 
sometimes read the conf file and load DB_type to see if it's mysql.

Anyway, I've drop all the code that was working yesterday on  my system.

Regards,

Olivier.

PS: I still think that one variable shoud be sufficient: DB_ENGINE that could 
have values: "file", "db", "sqlite", "mysql", "pgsql", "oracle", ... And yes, 
"file" can be seen as the most basique database engine. IMHO, this model is 
easier to handle in code. OSCAR 6.2.0? ;-)

Le vendredi 4 décembre 2009 06:22:08 geoffroy.val...@free.fr, vous avez écrit :
> Olivier,
> 
> db_type can be set to mysql and this is actually the default value. I do not 
> understand why you say this is "lost" (especially since you are using capital 
> letters, i guess you want to make a strong case here, where i know for a fact 
> that this is used correctly).
> About the name, i do not really care right now and actually i think it is 
> better to not touch it so we do not have to modify the code all over the 
> place. I also think adding a new variable is not necessary. However, i will 
> update the comments that are not clear enough.
> 
> And again, as i said before, the support of different "engines" (btw, files 
> are not an engine) is not on the todo list right now and do not prevent OSCAR 
> to work. I will not include patches regarding those points before 6.1.0, the 
> priority is currently to close bugs and not to make the code "nicer". 
> 
> I hope you understand my position.
> 
> regards,
> 
> ----- "Olivier LAHAYE" <olivier.lah...@cea.fr> a écrit :
> 
> > Geoffroy,
> > 
> > db_type is /etc/oscar/oscar.conf:ODA_TYPE. Values can be either "file"
> > or "db"
> >  /etc/oscar/oscar.conf:DB_TYPE is simply LOST. Values can be: mysql,
> > pgsql or ant other future engines supported.
> > 
> > More over this variable is misleading and should be renamed DB_ENGINE.
> > But in order to avoid rewrite code and avoid problems, I did not
> > change it.
> > My patch was meant to avoid ugly stuffs in the code like
> > $ENV{OSCAR_DB} to retrieve the name of the database engine (as it is
> > not read by configurator)
> > Because it is difficult to have this information, many pieces of code
> > have mysql hardcoded in it.
> > 
> > Another clean and optimal solution could be to use ODA_TYPE with
> > values: file, mysql, pgsql, ...
> > But this implies to rewrite some code: if ($config->{db_type} eq "db")
> > should be replaced by if !($config->{db_type} eq "file")
> > 
> > I personally would prefer this solution.(and I can review code for
> > it).
> > 
> > Just tell me.
> > 
> > Regards,
> > 
> > Olivier.
> > 
> > Le mercredi 2 décembre 2009 19:31:27, vous avez écrit :
> > > Olivier,
> > >
> > > What is the db_type and how is it different from the db_engine?
> > >
> > > With db_type you can already defint MYSQL vs. prosgresql and so
> > on...
> > >
> > > Regards,
> > >
> > > ----- "Olivier LAHAYE" <olivier.lah...@cea.fr> a écrit :
> > >
> > > > adds $db_engine in configmanager so we can avoid hardcoding of
> > mysql.
> > > >
> > >
> > 
> > --
> >     Olivier LAHAYE
> >     CEA Saclay
> >     DRT-LIST-DETECS-SSTM
> > 
> > ------------------------------------------------------------------------------
> > Join us December 9, 2009 for the Red Hat Virtual Experience,
> > a free event focused on virtualization and cloud computing.
> > Attend in-depth sessions from your desk. Your couch. Anywhere.
> > http://p.sf.net/sfu/redhat-sfdev2dev
> > _______________________________________________
> > Oscar-devel mailing list
> > Oscar-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/oscar-devel
> 

-- 
        Olivier LAHAYE
        CEA Saclay
        DRT-LIST-DETECS-SSTM

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Oscar-devel mailing list
Oscar-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oscar-devel

Reply via email to