Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Backports:SLE-15-SP6
python-py3dns
python3-py3dns-handle-absent-resolv.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File python3-py3dns-handle-absent-resolv.patch of Package python-py3dns
From c95cb269a6f0cb57c1204c29bec30d40e41eb2ef Mon Sep 17 00:00:00 2001 From: Ralph Bean <rbean@redhat.com> Date: Thu, 2 Feb 2017 12:19:00 -0500 Subject: [PATCH] Handle /etc/resolv.conf --- DNS/Base.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) Index: py3dns-3.2.1/DNS/Base.py =================================================================== --- py3dns-3.2.1.orig/DNS/Base.py +++ py3dns-3.2.1/DNS/Base.py @@ -11,7 +11,7 @@ Changes for Python3 port © 2011-14 Scot Base functionality. Request and Response classes, that sort of thing. """ -import socket, string, types, time, select +import socket, string, types, time, select, warnings import errno from . import Type,Class,Opcode import asyncore @@ -50,8 +50,12 @@ defaults= { 'protocol':'udp', 'port':53, def ParseResolvConf(resolv_path="/etc/resolv.conf"): "parses the /etc/resolv.conf file and sets defaults for name servers" - with open(resolv_path, 'r') as stream: - return ParseResolvConfFromIterable(stream) + try: + with open(resolv_path, 'r') as stream: + return ParseResolvConfFromIterable(stream) + except FileNotFoundError as e: + warnings.warn(e) + return def ParseResolvConfFromIterable(lines): "parses a resolv.conf formatted stream and sets defaults for name servers"
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor