From a0d314dfcee650ac62adf9aae22b04c52663d81e Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 13 Feb 2014 15:55:30 +0100 Subject: lib: Remove socket wrapper python module. Signed-off-by: Andreas Schneider Reviewed-by: Stefan Metzmacher Autobuild-User(master): Stefan Metzmacher Autobuild-Date(master): Thu Apr 17 17:12:50 CEST 2014 on sn-devel-104 --- lib/socket_wrapper/socket.py | 50 -------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 lib/socket_wrapper/socket.py (limited to 'lib/socket_wrapper/socket.py') diff --git a/lib/socket_wrapper/socket.py b/lib/socket_wrapper/socket.py deleted file mode 100644 index ccbb820899..0000000000 --- a/lib/socket_wrapper/socket.py +++ /dev/null @@ -1,50 +0,0 @@ -# Wrapper for socket wrapper (based on python socket wrapper) -# Copyright (C) Amitay Isaacs 2011 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# - -import _socket -from _socket import * - -from samba.socket_wrapper import socket - - -def getfqdn(name=''): - """Get fully qualified domain name from name. - - An empty argument is interpreted as meaning the local host. - - First the hostname returned by gethostbyaddr() is checked, then - possibly existing aliases. In case no FQDN is available, hostname - from gethostname() is returned. - """ - name = name.strip() - if not name or name == '0.0.0.0': - name = gethostname() - try: - hostname, aliases, ipaddrs = gethostbyaddr(name) - except error: - pass - else: - aliases.insert(0, hostname) - for name in aliases: - if '.' in name: - break - else: - name = hostname - return name - - -_GLOBAL_DEFAULT_TIMEOUT = object() -- cgit