mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
rhn_channel: fix py3 compatibility (use six)
and remove unused import
This commit is contained in:
parent
5f62a973da
commit
f761fc1d1f
2 changed files with 4 additions and 9 deletions
|
@ -64,9 +64,8 @@ EXAMPLES = '''
|
|||
password: guessme
|
||||
'''
|
||||
|
||||
import xmlrpclib
|
||||
from operator import itemgetter
|
||||
import re
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.six.moves import xmlrpc_client
|
||||
|
||||
|
||||
# ------------------------------------------------------- #
|
||||
|
@ -137,8 +136,8 @@ def main():
|
|||
user = module.params['user']
|
||||
password = module.params['password']
|
||||
|
||||
#initialize connection
|
||||
client = xmlrpclib.Server(saturl, verbose=0)
|
||||
# initialize connection
|
||||
client = xmlrpc_client(saturl)
|
||||
session = client.auth.login(user, password)
|
||||
|
||||
# get systemid
|
||||
|
@ -165,8 +164,5 @@ def main():
|
|||
client.auth.logout(session)
|
||||
|
||||
|
||||
# import module snippets
|
||||
from ansible.module_utils.basic import *
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue