|
From: Branko M. <br...@ma...> - 2013-05-14 15:40:25
|
On Mon, 13 May 2013 18:32:37 +0200
Gémes Géza <ge...@kz...> wrote:
> Hi,
>
> Fixed lib64 handling in the attached script
>
> Started to work on forcing a kerberized bind in the case of a remote
> server.
>
> Cheers
>
> Geza Gemes
Hello again :)
Once again, be warned, nothing really wrong with script, just me
nitpicking :)
- Ran a quick PEP8 on it again, and actually learned something
interesting myself. In line 94 you have check "hostname ==
None" (instead of "is None"). Seeing you used elsewhere "is not
None", probably just an oversight.
- You could probably optimise the Samba Python path guessing by setting
default value of samba_install_path to "/usr/local/samba/" (and
dropping the two elif's). One thing to keep in mind, though - if the
user had installed Samba from a package, they probably already have
their Python path set-up correctly to find Samba modules. Personally,
I would probably not try to guess the directory, and instead either
expect the user to set-up his/her PYTHON_PATH, or provide the path
explicitly with the --samba_install_path option.
- On line 118 - typo, should say "could not".
- Lines 156 through 166 - you can avoid lots of conditionals here by
simply having the default values setup for option/argument parser.
- One thing I'm curious about - when initialising the GetDC class, you
prompt for username/password when hostname has been specified, but if
it's not specified you set the username/password to ''. I'm guessing
when it connects to localhost it doesn't need to authenticate at all?
If so, maybe just add a small note for the "--hostname" option ("if
specified, you will be prompted for username and password for
logging-in into the provided serrver")
- Don't default the hostname parameter to None in function generate_req
- that's probably something that should always be provided (plus, if
it's None, the None + "somestring" will throw you an exception).
Otherwise, very nice - it's great you added the error handling and
checks for existing files :)
Best regards
--
Branko Majic
Jabber: br...@ma...
Please use only Free formats when sending attachments to me.
Бранко Мајић
Џабер: br...@ma...
Молим вас да додатке шаљете искључиво у слободним форматима.
|