For example, this is an working access to the SCR: ----------------------------------- #!/usr/bin/ruby require "dbus" system_bus = DBus::SystemBus.instance # Get the yast service yast = system_bus.service("org.opensuse.yast.SCR") # Get the object from this service objYast = yast.object("/SCR") objYast.introspect puts objYast.interfaces poiSCR = DBus::ProxyObjectInterface.new(objYast, "org.opensuse.yast.SCR.Methods") poiSCR.define_method("Read", "in path:(bsv), in arg:(bsv), in opt:(bsv)") p poiSCR.Read([false, "path", ["s",".sysconfig.language.RC_LANG"] ], [false, "", ["s",""] ], [false, "", ["s",""] ]) main = DBus::Main.new main << system_bus main.run ------------------------------------------- This returns: org.opensuse.yast.SCR.Methods [[false, "string", "de_DE.UTF-8"]] By the way. The call is VERY fast. :-) So the reason for the slow YaST module has to be somewhere else. Greetings Stefan Stefan Schubert schrieb:
Hi, thank you for the documentation. In the last few days I have had a look into the DBUS-SCR interface and it has already worked very well.
Then I have tried to connect this DBUS interface via Ruby without success cause I was not able to map the requested arguments correctly. ( Maybe due the lack of my ruby knowledges. Hm, but I have manged other DBUS interfaces e.g. org.freedesktop.ConsoleKit :-) )
I believe that our interface is too complex:
Read ( STRUCT of (Boolean, STRING, VARIANT) path, STRUCT of (Boolean, STRING, VARIANT) arg, STRUCT of (Boolean, STRING, VARIANT) opt) Execute ( STRUCT of (Boolean, STRING, VARIANT) path, STRUCT of (Boolean, STRING, VARIANT) arg, STRUCT of (Boolean, STRING, VARIANT) opt) Write( STRUCT of (Boolean, STRING, VARIANT) path, STRUCT of (Boolean, STRING, VARIANT) arg, STRUCT of (Boolean, STRING, VARIANT) opt)
The return values are not more clearlier: STRUCT of (Boolean, STRING, VARIANT) path, STRUCT of (Boolean, STRING, VARIANT) arg, STRUCT of (Boolean, STRING, VARIANT) opt, STRUCT of (Boolean, STRING, VARIANT) ret)
Especial the VARIANT argument is not understandable by the user who uses this interface cause he does not know the internals.
So, if we would like to use the SCR via DBUS in other applications ( e.g. a web-service server) we should simplify the interface. I would like to have an interface like:
Read ( STRING path, STRING arg, STRING outputFormat) path: e.g. .sysconfig.console.CONSOLE_MAGIC arg: e.g. /etc/install.inf for the call SCR::Read (.target.size, "/etc/install.inf") outputFormat: XML, String, YaST, ...
Execute ( STRING path, STRING command, STRING YaSTarg, STRING outputFormat) path: e.g. .target.bash command : e.g. "/bin/touch /etc/modprobe.d/tv" YaSTarg: Special YaST arguments like $[ "C_locale" : true, "env" : $[ "LC_ALL" : "en_US" ] ] outputFormat: XML, String, YaST, YaSTBinary, ...
Write ( STRING path, STRING value )
The return value should always be a STRING with a special kind like XML, YaST, ... (defined in the arguments)
The other possibility would be to take the complete argument list into one STRING:
e.g. Write (".sysconfig.displaymanager.DISPLAYMANAGER_XSERVER, \"Xgl\") and parse it in the DBUS server.
Would this be possible? It would increase the acceptance of the API. Are there other options ? I fear otherwise no one ( with the exception of YaST) would be able to use the SCR via DBUS.
Martin, Ladislav what do you think about ?
Greetings Stefan
Ladislav Slezak schrieb:
Hi all!
I'd like to inform you about a new feature in Yast in openSUSE-11.1-Alpha1.
The feature allows you to configure role based access to yast. The current implementation is limited only to some yast functionality (the SCR part), e.g. it doesn't allow to install packages by a non-root user.
WARNING: the DBus support is still in development state, it may be buggy or whatever else... I ask the brave people here to give it a try.
See http://en.opensuse.org/YaST/DBus_Integration for more details. There is an example how to enable "time zone change" task for a non-root user.
If you find any problem with the DBus integration report it to bugzilla.novell.com and assign the bug to me. Do not forget to attach also the non-root log file (described in the link above).
--
Best Regards
Ladislav Slezák Yast Developer ------------------------------------------------------------------------ SUSE LINUX, s.r.o. e-mail: lslezak@suse.cz Lihovarská 1060/12 tel: +420 284 028 960 190 00 Prague 9 fax: +420 284 028 951 Czech Republic http://www.suse.cz/
-- ******************************************************************************* Stefan Schubert SUSE LINUX GmbH - Maxfeldstrasse 5 - D-90409 Nuernberg, Germany e-mail: schubi@suse.de ------------------------------------------------------------------------------- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org