This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Savane-cleanup framework".
The branch, master has been updated via bbeaa707f18eaba9996a076bccc32c1bd5144e82 (commit) from 0860e68a847272ced4cad82fed1e5dd26fab3c1b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://git.savannah.gnu.org/cgit/savane-cleanup/framework.git/commit/?id=bbeaa707f18eaba9996a076bccc32c1bd5144e82 commit bbeaa707f18eaba9996a076bccc32c1bd5144e82 Author: Jonathan Gonzalez V <z...@gnu.org> Date: Wed Aug 26 14:35:31 2009 -0400 Added a new python package utils diff --git a/src/savane/utils/__init__.py b/src/savane/utils/__init__.py new file mode 100644 index 0000000..85b69e5 --- /dev/null +++ b/src/savane/utils/__init__.py @@ -0,0 +1,39 @@ +# Utility functions for savane +# Copyright (C) 2009 Jonathan Gonzalez V. +# +# This file is part of Savane. +# +# Savane is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# Savane is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +import os +from subprocess import Popen, PIPE + +def ssh_key_fingerprint( ssh_key ): + if ssh_key is None or len(ssh_key) == 0: + return None + + file_name = '/tmp/%d' % random.randint(0, int(time.time())) + + tmp_file = open( file_name, 'wb+' ) + tmp_file.write( ssh_key ) + tmp_file.close() + + cmd = 'ssh-keygen -l -f %s' % file_name + pipe = Popen( cmd, shell=True, stdout=PIPE).stdout + res = re.search("not a public key file", pipe.readline()) + if res is not None: + raise forms.ValidationError( "The uploaded string is not a public key file" ) + + return ssh_key + ----------------------------------------------------------------------- Summary of changes: sbin/sv => src/savane/utils/__init__.py | 38 ++++++++++++++++++------------ 1 files changed, 23 insertions(+), 15 deletions(-) copy sbin/sv => src/savane/utils/__init__.py (50%) mode change 100755 => 100644 hooks/post-receive -- Savane-cleanup framework _______________________________________________ Savannah-cvs mailing list Savannah-cvs@gnu.org http://lists.gnu.org/mailman/listinfo/savannah-cvs