1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

cobbler: Add Python 3 support (#645)

This commit is contained in:
Dag Wieers 2020-12-16 13:37:31 +01:00 committed by GitHub
parent 757427cadf
commit c3ef9bf668
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- cobbler - add Python 3 support (https://github.com/ansible-collections/community.general/issues/638).

View file

@ -52,7 +52,10 @@ import argparse
import os
import re
from time import time
import xmlrpclib
try: # Python 3
from xmlrpc.client import Server
except ImportError: # Python 2
from xmlrpclib import Server
import json
@ -106,7 +109,7 @@ class CobblerInventory(object):
def _connect(self):
if not self.conn:
self.conn = xmlrpclib.Server(self.cobbler_host, allow_none=True)
self.conn = Server(self.cobbler_host, allow_none=True)
self.token = None
if self.cobbler_username is not None:
self.token = self.conn.login(self.cobbler_username, self.cobbler_password)