mirror of
https://github.com/xcat2/confluent.git
synced 2026-03-31 22:43:32 +00:00
Replace some pyghmi references and modernize some asyncio invocations
This commit is contained in:
@@ -60,4 +60,4 @@ async def main():
|
||||
sys.exit(exitcode)
|
||||
|
||||
if __name__ == '__main__':
|
||||
asyncio.get_event_loop().run_until_complete(main())
|
||||
asyncio.run(main())
|
||||
|
||||
@@ -438,4 +438,4 @@ async def main():
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
asyncio.get_event_loop().run_until_complete(main())
|
||||
asyncio.run(main())
|
||||
|
||||
@@ -74,4 +74,4 @@ async def main():
|
||||
sys.exit(exitcode)
|
||||
|
||||
if __name__ == '__main__':
|
||||
asyncio.get_event_loop().run_until_complete(main())
|
||||
asyncio.run(main())
|
||||
|
||||
@@ -19,7 +19,8 @@ try:
|
||||
from urllib import urlencode
|
||||
except ImportError:
|
||||
from urllib.parse import urlencode
|
||||
webclient = eventlet.import_patched('pyghmi.util.webclient')
|
||||
import aiohmi.util.webclient as webclient
|
||||
|
||||
|
||||
class NodeHandler(bmchandler.NodeHandler):
|
||||
DEFAULT_USER = 'admin'
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
|
||||
import codecs
|
||||
import confluent.discovery.handlers.bmc as bmchandler
|
||||
import pyghmi.exceptions as pygexc
|
||||
import pyghmi.ipmi.private.util as pygutil
|
||||
import aiohmi.exceptions as pygexc
|
||||
import aiohmi.ipmi.private.util as pygutil
|
||||
import confluent.util as util
|
||||
import struct
|
||||
|
||||
|
||||
@@ -16,7 +16,9 @@ import codecs
|
||||
import confluent.discovery.handlers.bmc as bmchandler
|
||||
import confluent.exceptions as exc
|
||||
import eventlet
|
||||
webclient = eventlet.import_patched('pyghmi.util.webclient')
|
||||
|
||||
import aiohmi.util.webclient as webclient
|
||||
|
||||
import struct
|
||||
try:
|
||||
from urllib import urlencode
|
||||
|
||||
@@ -16,8 +16,6 @@ import confluent.discovery.handlers.redfishbmc as redfishbmc
|
||||
import eventlet.support.greendns
|
||||
import confluent.util as util
|
||||
|
||||
webclient = eventlet.import_patched('pyghmi.util.webclient')
|
||||
|
||||
|
||||
|
||||
getaddrinfo = eventlet.support.greendns.getaddrinfo
|
||||
|
||||
@@ -94,7 +94,7 @@ def lenovoname(idx, desc):
|
||||
return desc
|
||||
|
||||
nameoverrides = [
|
||||
(re.compile('20301\..*'), lenovoname),
|
||||
(re.compile(r'20301\..*'), lenovoname),
|
||||
]
|
||||
|
||||
# Lenovo chassis id rule is match only first 5 bytes for a match.....
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
import confluent.util as util
|
||||
import time
|
||||
import eventlet
|
||||
webclient = eventlet.import_patched('pyghmi.util.webclient')
|
||||
import aiohmi.util.webclient as webclient
|
||||
|
||||
|
||||
|
||||
_healthmap = {
|
||||
'normal': 'ok',
|
||||
|
||||
@@ -1308,7 +1308,7 @@ if __name__ == '__main__':
|
||||
os.umask(0o022)
|
||||
if len(sys.argv) > 2:
|
||||
mfd = os.environ.get('CONFLUENT_MEDIAFD', None)
|
||||
asyncio.get_event_loop().run_until_complete(import_image(sys.argv[1], callback=printit, backend=True, mfd=mfd, custtargpath=sys.argv[3], custdistpath=sys.argv[4], custname=sys.argv[5]))
|
||||
asyncio.run(import_image(sys.argv[1], callback=printit, backend=True, mfd=mfd, custtargpath=sys.argv[3], custdistpath=sys.argv[4], custname=sys.argv[5]))
|
||||
else:
|
||||
asyncio.get_event_loop().run_until_complete(import_image(sys.argv[1], callback=printit))
|
||||
asyncio.run(import_image(sys.argv[1], callback=printit))
|
||||
|
||||
|
||||
@@ -30,6 +30,13 @@ import aiohmi.redfish.command as rcmd
|
||||
import aiohmi.util.webclient as webclient
|
||||
import aiohttp
|
||||
|
||||
try:
|
||||
raise Exception('TODO: Migrate to aiohttp websocket')
|
||||
websocket = eventlet.import_patched('websocket')
|
||||
wso = websocket.WebSocket
|
||||
except Exception:
|
||||
wso = object
|
||||
|
||||
class CustomVerifier(aiohttp.Fingerprint):
|
||||
def __init__(self, verifycallback):
|
||||
self._certverify = verifycallback
|
||||
|
||||
@@ -23,8 +23,8 @@ import confluent.exceptions as cexc
|
||||
import confluent.interface.console as conapi
|
||||
import confluent.log as log
|
||||
import confluent.util as util
|
||||
import pyghmi.exceptions as pygexc
|
||||
import pyghmi.redfish.command as rcmd
|
||||
import aiohmi.exceptions as pygexc
|
||||
import aiohmi.redfish.command as rcmd
|
||||
import eventlet
|
||||
import eventlet.green.ssl as ssl
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user