Mailinglist Archive: yast-devel (66 mails)

< Previous Next >
Re: [yast-devel] Ruby code in SCR
* Josef Reidinger <jreidinger@xxxxxxx> [Jun 21. 2013 10:40]:
On Thu, 20 Jun 2013 15:14:54 +0200
Klaus Kaempf <kkaempf@xxxxxxx> wrote:

Exactly. Put all the 'knowledge' into SCR and shield SCR users from
this.


And this is where I see problem. Let consider two main use cases for
community developers who want to add new module to YaST or reuse part
of YaST.
[...]

Sorry for not being clear on this. When I wrote "SCR" in the above
context, I meant "common backend".

If we use for files augeas and for running script direct calls, then it
is easy to reuse it almost everywhere immediately.

If every YaST module uses Augeas to modify configuration files, all is
fine. Then Augeas is the 'common backend'.


So for me it should be handled by *installation* module

modules.each { |mod| mod::Proposal() }
show_gui()
if (accepted)
chroot("/mnt") do
modules.each { |mod| mod::write_settings() }
end
end


Fully agreed. The module does not know that it is run in chroot, only
the installation module has this knowledge.


and in Network::Write can be

Network::Write(map m)
m[:network_card].each do |card|
setup_card(card)
end
`rcnetwork restart` # or call System, or call directly Systemd or
another module or Cheetah, it is up to you
end

I struggle a lot with the explicit call to 'rcnetwork restart'. There
you put explicit backend knowledge into the (resp. each) module.

I'd rather see something like Backend::RestartService("network") here.



So for simple modules you can use direct write or file edit,

See my last mail to Johannes why I would not go down this path.


At the end of the day, we are talking about 'best practices' here. The
old YaST (partly) enforced best practices by just offering one way to
access the system (via SCR).

The new YaST should encourage best practices but cannot effectively
prevent module developers from file.puts()


Klaus
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB
16746 (AG Nürnberg)
Maxfeldstraße 5, 90409 Nürnberg, Germany
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: yast-devel+owner@xxxxxxxxxxxx

< Previous Next >