- Dec 20, 2012
-
-
Michael Hanselmann authored
Addresses issue 147. Only the hostnames resolved using “netutils.Hostname($name)” were normalized, but those returned by the class method “GetSysName” weren't. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
- Oct 09, 2012
-
-
Iustin Pop authored
This exception is documented to have three arguments, but in one case we raise it with a simple string argument. Let's fix that. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Sep 21, 2012
-
-
Michael Hanselmann authored
This enables the hostname seen by other code through Hostname.GetFqdn to be changed through the environment variable “GANETI_HOSTNAME”. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
- Sep 03, 2012
-
-
Iustin Pop authored
To help developing Ganeti on newer distributions, let's try to fix pylint warnings/errors. I'm using pylint from current Debian wheezy: pylint 0.25.1, astng 0.23.1, common 0.58.0, and we have 3 things that needs fixing. First, a really wide "except", with the silencing in the wrong place. I'm not sure why this doesn't have "except Exception", so let's add it. However, pylint still complains about "Catching too general exception", even though we do want to catch both system and our exception, so let's add a silence for W0703. It's true that we shouldn't catch KeyboardInterrupt and friends, but that should be cleaned up on the master branch. Second, pylint complains about "redefining name builtin tuple", because we do some pattern matching in the except blocks in netutils. This seems to be a false positive, but let's clean the code around this. And finally, type inference again goes bad, so let's silence E1103 with its "boolean doesn't have 'get' method". After this, I can run "make lint", and by extension "make commit-check" on Debian Wheezy, yay! We might be able to bump our required pylint versions to something not ancient… Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Oct 05, 2011
-
-
Andrea Spadaccini authored
Add the following methods to netutils.IPAddress: * ValidateNetmask * GetClassFromIpVersion * GetClassFromIpFamily Also, add related tests to the test suite. Signed-off-by:
Andrea Spadaccini <spadaccio@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Aug 30, 2011
-
-
Andrea Spadaccini authored
Running pylint 0.24.0 revealed 2 errors and 1 warning. Here is how I fixed them: * jqueue.py: silenced E1101 * netutils.py: rewrote the list comprehension using extend() * watcher/__init__.py: fixed a missing format string parameter These changes are backwards-compatible with pylint 0.21.1. Signed-off-by:
Andrea Spadaccini <spadaccio@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Aug 25, 2011
-
-
Michael Hanselmann authored
Identified using the “pep8” utility. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Aug 11, 2011
-
-
Andrea Spadaccini authored
Added the following functions to netutils: - IsValidInterface - GetInterfaceIpAddresses - _GetIpAddressesFromIpOutput Added the following static methods to netutils.IPAddress: - GetAddressFamilyFromVersion - GetVersionFromAddressFamily Added unit tests for the new methods in netutils.IPAddress, for the IP address search regex and for GetInterfaceIpAddresses Signed-off-by:
Andrea Spadaccini <spadaccio@google.com> Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Jul 25, 2011
-
-
Iustin Pop authored
s/'/"/ in (hopefully) the right places. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Feb 17, 2011
-
-
René Nussbaumer authored
Signed-off-by:
René Nussbaumer <rn@google.com> Reviewed-by:
Stephen Shirley <diamond@google.com>
-
- Aug 23, 2010
-
-
Manuel Franceschini authored
Signed-off-by:
Manuel Franceschini <livewire@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Manuel Franceschini authored
By doing this we delegate the task of finding the correct address family to the FormatAddress method. Signed-off-by:
Manuel Franceschini <livewire@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Aug 20, 2010
-
-
Manuel Franceschini authored
This patch restores the behaviour of Hostname (previously known as HostInfo) to always use fqdn. This was broken due to the fact that the now used getaddrinfo does not return an fqdn in contrast to gethostbyname_ex(). This patch adds Hostname.GetFqdn() which is always used when initializing a Hostname object. A problem this solves is when adding a node and not using its fqdn, node verify won't complain. Signed-off-by:
Manuel Franceschini <livewire@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Aug 19, 2010
-
-
Manuel Franceschini authored
Signed-off-by:
Manuel Franceschini <livewire@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Manuel Franceschini authored
These missing changes were initially agreed upon but then forgotten. First, we move the valid name regex to the class-level such that it won't be compiled for every invocation of GetIP() and we wrap the result of getaddrinfo() into a try/except to catch a possible IndexError. Signed-off-by:
Manuel Franceschini <livewire@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Aug 18, 2010
-
-
Manuel Franceschini authored
Signed-off-by:
Manuel Franceschini <livewire@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Manuel Franceschini authored
This patch moves the FormatAddress helper function from daemon.py to netutils.py. This enables its use in http.client as well as in rapi.client. Furthermore this adds functionality to format IPv6 addresses according to RFC 3986. It is required for use of literal IPv6 addresses in URLs in pycurl. For some reason it worked also without the bracketing ("["<address>"]"), but we do not want to rely on that. Signed-off-by:
Manuel Franceschini <livewire@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Manuel Franceschini authored
This patch enables IPv6 name resolution by using socket.getaddrinfo instead of socket.gethostbyname_ex. It renames the HostInfo class to Hostname and unifies its use throughout the code. This is achieved by using static calls where no object is needed and removes some obsolete code. For now, we just resolve to IPv4 addresses, but this will change once it is needed. Signed-off-by:
Manuel Franceschini <livewire@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Manuel Franceschini authored
This patch unifies the netutils functions dealing with IP addresses to three classes: - IPAddress: Common IP address functionality - IPv4Address: IPv4 specific functionality - IPv6address: IPv6-specific functionality Furthermore it adds methods to check whether an address is a loopback address, replacing the .startswith("127") for IPv4 and adding IPv6 support. It also provides the basis for future IPv6 address handling. Methods to convert IP strings to their corresponding interger values will allow to canonicalize IPv6 addresses. Signed-off-by:
Manuel Franceschini <livewire@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Jul 09, 2010
-
-
Manuel Franceschini authored
This patch moves network utility functions to a dedicated module. Signed-off-by:
Manuel Franceschini <livewire@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-