geoip: fix lints

This commit is contained in:
Dan Bungert 2022-02-11 15:45:16 -07:00
parent ebdf1db636
commit b5f0d1fa73
2 changed files with 2 additions and 3 deletions

View File

@ -75,9 +75,10 @@ class HTTPGeoIPStrategy(GeoIPStrategy):
""" HTTP implementation to retrieve GeoIP information. We use the
geoip.ubuntu.com service. """
async def get_response(self) -> str:
url = "https://geoip.ubuntu.com/lookup"
try:
async with aiohttp.ClientSession() as session:
async with session.get("https://geoip.ubuntu.com/lookup") as response:
async with session.get(url) as response:
response.raise_for_status()
return await response.text()
except aiohttp.ClientError as e:

View File

@ -13,8 +13,6 @@
# 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 mock
from aioresponses import aioresponses
from subiquitycore.tests import SubiTestCase