|
From: External C. L. (CAMPUS) <ext...@ox...> - 2008-10-30 10:10:06
|
1° database export For the database export, this is what i thought. But I can't see the definition for the symbolic operation I created: grep augeas /var/lib/symbolic/db/* /var/lib/symbolic/db/symbolicDb.log:INSERT INTO OPERATION_LOG VALUES(5,1,'2008-10-29 16:02:31.501000000',NULL,2,5,'nladev03.neptune.dkcorp.net-changeconf_augeas-chgParam-1225292553.724438',FALSE,NULL,NULL,1,2,'') /var/lib/symbolic/db/symbolicDb.log:INSERT INTO OPERATION_LOG VALUES(6,1,'2008-10-29 17:50:12.182000000',NULL,2,5,'nladev03.neptune.dkcorp.net-changeconf_augeas-chgParam-1225299014.0967519',FALSE,NULL,NULL,1,2,'') /var/lib/symbolic/db/symbolicDb.log:INSERT INTO OPERATION_LOG VALUES(5,2,'2008-10-29 16:02:31.501000000','Func Async Process Lost!',2,5,'nladev03.neptune.dkcorp.net-changeconf_augeas-chgParam-1225292553.724438',FALSE,'WARN: Func Server was probably restart after command ran on client.',NULL,3,2,'') /var/lib/symbolic/db/symbolicDb.log:INSERT INTO OPERATION_LOG VALUES(8,1,'2008-10-29 17:53:54.177000000',NULL,2,5,'nladev03.neptune.dkcorp.net-changeconf_augeas-chgParam-1225299238.6513391',FALSE,NULL,NULL,1,2,'') /var/lib/symbolic/db/symbolicDb.script:INSERT INTO MODULE VALUES(3,0,'changeconf_augeas','Default Description','','chgParam,module_description,module_version,get_method_args,module_api_version,list_methods','changeconf_augeas') Where are Operations stored ? 2° my module Here is the module (POC version, I'm still working on it): #changeconf_augeas.py try: from func_module import FuncModule except: class FuncModule: pass class chgConf(FuncModule): version = "0.0.1" api_version = "0.0.1" description = "Change parameters in plain text configuration files, with the help of Augeas." def chgParam(self,fileName,param,pvalue): """Change a value for a config. parameter in a plain text config. file with the help of Augeas, a configuration API (cf http://augeas.net) """ try: from augeas import augeas aug=augeas() except Exception, e: return str(e) path='/files/'+fileName try: getTest=aug.get(path+"/"+param) except Exception, e: return str(e) if not getTest: message="""Failed. Possible reasons: - the config file does not exist - the config parameter does not exist in the config file - Augeas does not handle the configuration format as expected""" return message try: aug.set(path+"/"+param,pvalue) except Exception, e: return str(e) try: aug.save() except Exception, e: return str(e) try: getTest=aug.get(path+"/"+param) except Exception, e: return str(e) return [fileName,param,getTest] In parallel I will make some new check with a very simple test module using methods with more than 1 parameter. Louis -----Original Message----- From: Marco Mornati [mailto:mmo...@by...] Sent: Thursday, October 30, 2008 9:46 AM To: External COILLIOT Louis (CAMPUS) Cc: sym...@li... Subject: Re: [Symbolic-users] FW: Operation Running On Wed, 2008-10-29 at 17:57 +0100, External COILLIOT Louis (CAMPUS) wrote: > I checked the func logs, I have this: > > > > 2008-10-29 17:10:00,995 - DEBUG - cn: testintegr3.neptune.dkcorp.net-CA-KEY sub_hash: 1837371380 > 2008-10-29 17:10:00,997 - DEBUG - acls {u'testintegr3.neptune.dkcorp.net-CA-KEY-1837371380': ['*']} > 2008-10-29 17:10:00,997 - DEBUG - hostkey testintegr3.neptune.dkcorp.net-CA-KEY-1837371380 > 2008-10-29 17:10:01,026 - DEBUG - (X) ------------------------------------------- > 2008-10-29 17:10:01,029 - INFO - Exception occured: exceptions.TypeError > 2008-10-29 17:10:01,029 - INFO - Exception value: chgParam() takes exactly 4 arguments (2 given) > 2008-10-29 17:10:01,030 - INFO - Exception Info: > File "/usr/lib/python2.4/site-packages/func/minion/server.py", line 136, in __call__ > rc = self.__method(*args) > > > So: > - the error doesn't get back to Symbolic > - there is a problem passing args > Did you try with more than one or two ? > The separator between the args in the form is really ' ' ? > With 'raw' func it works fine. > I'd like to give you an export of the piece of hsql database that defines the operation, but I don't know how. > Yes we have tested with more than one parameter... but maybe there is a specific problem calling that one. We are making a call using "func-trasmit" (so not CLI) and all "instructions" are passed through a yaml/json serialization. Can I have your module code to make some specific test... so I can see what are working wrong in that situation? To "export" the hsqldb you just need to copy the db files you can find in symbolic folder (if I remember well /var/lib/symbolic/db). > > > I don't understand your real question > > (...) > > when you are creating new operation inside Symbolic, it proposes the list of required parameter for selected method > That's a part of the answer I seeked for. > > > you need to add the name of server to "default" operation parameters. > What I mean is that I try to do that with a list of parameters, like: > func '*' call changeconf_augeas chgParam /etc/ssh/sshd_config PermitRootLogin yes > > Param list -> /etc/ssh/sshd_config PermitRootLogin yes > > > > 3) Propose in a form (on another page?) and not "add parameter" or writing something in a list? Yes... could be better... In this moment I couldn't see Symbolic because I'm out of office. Tomorrow morning I take care to your suggestion and I'll write you an email with proposal to change this part. > If you have any suggestion about this... let me know. > > "add parameter" is fine but it should provide the args of the methods as parameter names (with a select form ?), I think. > > Bye > Marco > > ------------ > Dott. Ing. Mornati Marco > Byte-Code s.r.l > via Antonio Cechov, 1 > San Giuliano Milanese (MI) > E-Mail: mmo...@by... > Mob. +39 3388246643 > Int. +39 02 45074942 > Tel. +39 02 9840047 > Fax. +39 02 98247475 > > ----- Original Message ----- > From: "External COILLIOT Louis (CAMPUS)" <ext...@ox...> > To: mmo...@by..., "stephane.dobbelaere" <ste...@th...> > Cc: "luca foppiano" <lu...@fo...>, "franck.lemaire" <fra...@th...> > Sent: Wednesday, October 29, 2008 4:49:01 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna > Subject: Operation Running > > Hello Marco, > > I have one problem and 2 questions. > > > 1° Problem > > I try to get this operation working with Symbolic: > > func '*' call changeconf_augeas chgParam /etc/ssh/sshd_config PermitRootLogin yes > > It works fine with func console mode: > {'nladev03.neptune.dkcorp.net': ['/etc/ssh/sshd_config', > 'PermitRootLogin', > 'yes'], > 'nladev04.neptune.dkcorp.net': ['/etc/ssh/sshd_config', > 'PermitRootLogin', > 'yes']} > > > You can see the operation from Symbolic in attachment. > > But it gets stuck with Symbolic in 'Operation running'. See the log: > > 16:02:33.294 DEBUG Running OpLog ID 5 - Operation PermitRootlogin-No on nladev03.neptune.dkcorp.net (10.151.2.212) > 16:02:33.294 DEBUG Running OpLog ID 5 - Operation PermitRootlogin-No on nladev03.neptune.dkcorp.net (10.151.2.212) > --->1 ["/etc/ssh/sshd_config PermitRootLogin no"] > 16:02:33.324 DEBUG Calling JSon Values: {"module":"changeconf_augeas","nforks":1,"method":"chgParam","parameters":"/etc/ssh/sshd_config PermitRootLogin no ","async":true,"clients":"nladev03.neptune.dkcorp.net"} > 16:02:33.325 DEBUG Command to execute: ["func-transmit", "-j"] > 16:02:36.523 DEBUG Func raw result: ["processid":"nladev03.neptune.dkcorp.net-changeconf_augeas-chgParam-1225292553.724438"] > 16:02:36.523 DEBUG Func raw result: ["processid":"nladev03.neptune.dkcorp.net-changeconf_augeas-chgParam-1225292553.724438"] > 16:02:38.155 DEBUG Getting status for pid nladev03.neptune.dkcorp.net-changeconf_augeas-chgParam-1225292553.724438 > 16:02:38.157 DEBUG Calling JSon Values: {"nforks":1,"method":"job_status","parameters":"nladev03.neptune.dkcorp.net-changeconf_augeas-chgParam-1225292553.724438","async":0,"clients":"*"} > 16:02:38.158 DEBUG Command to execute: ["func-transmit", "-j"] > 16:02:38.671 DEBUG Process Response: [3,{}] > 16:02:38.686 DEBUG Func raw-result: ["status":3, "result":[:]] > 16:02:38.686 DEBUG Func raw-result: ["status":3, "result":[:]] > 16:02:38.688 DEBUG Job Partial! > 16:02:38.688 DEBUG Job Partial! > 16:02:43.160 DEBUG Getting status for pid nladev03.neptune.dkcorp.net-changeconf_augeas-chgParam-1225292553.724438 > 16:02:43.160 DEBUG Calling JSon Values: {"nforks":1,"method":"job_status","parameters":"nladev03.neptune.dkcorp.net-changeconf_augeas-chgParam-1225292553.724438","async":0,"clients":"*"} > 16:02:43.160 DEBUG Command to execute: ["func-transmit", "-j"] > 16:02:43.547 DEBUG Process Response: [3,{}] > 16:02:43.549 DEBUG Func raw-result: ["status":3, "result":[:]] > 16:02:43.549 DEBUG Func raw-result: ["status":3, "result":[:]] > 16:02:43.550 DEBUG Job Partial! > 16:02:43.550 DEBUG Job Partial! > > > 2° question > > I got a method chgParam that takes more than on param > def chgParam(self,fileName,param,pvalue): > (...) > > I can't find examples with more than on param. > For example, to check a service you need only the service name: > def status(self, service_name): > (...) > > In Symbolic 'Service status' operation you use: > User Parameter: 'Service Name' Type 'Text' Desc '...' > > How does 'Service Name' match with the attribute 'service_name' of the method 'status' ? > > What if there are more than one parameter ? > Is there a match between the order of the User Parameter list and the order of the attributes in the method ? > > 3° question > > Don't you think it could be more clear to propose the methods attributes list in the form for an operation ? > > Let me know. > > Louis > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Symbolic-users mailing list > Sym...@li... > https://lists.sourceforge.net/lists/listinfo/symbolic-users -- Dott. Ing. Mornati Marco Byte-Code s.r.l via Antonio Cechov, 1 San Giuliano Milanese (MI) E-Mail: mmo...@by... |