framework for samba3 hosts
Gerald (Jerry) Carter
jerry at samba.org
Tue Jul 26 04:09:57 GMT 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Amit Regmi wrote:
| Hi all,
|
| I have to design Samba Framework in Python .
| Previously I was facing problems on the design
| issues and still am confused. What I have at
| hand is a script to make changes in the smb.conf file.
|
| What I also have at present are the classes
|
| FileService class
| PrintService class
Amit,
Here some comments. I know you are still getting
your feet wet, but ...
~From make_smb_conf.py:
* Store you classes in file and import them so you
~ get code reuse.
* Don't hardcode path and values in your classes.
* class FileService should be a single share.
~ Therefore an AddShare() method doesn't make much
~ sense. You should be able to create a new
~ file share by simply creating a new FileService
~ object. This object would then be connected to
~ a SambaConf object to tie it to a configuration
~ file.
~From smb_tools.py
* Don't redefine the Server class, reuse code.
* Don't worry about checking the effective UID.
~ Let the OS do the security checks for you when
~ possible.
* Don't worry about wrapping existing tools just
~ for the sake of having a python wrapper.
| What I also want to do is come up with few
| functions like
|
| replace_A_Line_In_Smb_conf()
| edit_A_section_In_Smb_conf()
You already have this in the SambaConf object
I gave you. You read in the file and then set
a service option. Then just flush the file to disk.
cheers, jerry
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFC5beVIR7qMdg1EfYRAqddAKDa7SBY6EjCjQCgS7NfPPkSEuY5/ACdEo11
uPLF75wPiiGF06YXGTY9RFY=
=inOO
-----END PGP SIGNATURE-----
More information about the samba-technical
mailing list