Skip to content

Commit

Permalink
Fix pylint
Browse files Browse the repository at this point in the history
Signed-off-by: Tushar <[email protected]>
  • Loading branch information
tgupta3 committed May 11, 2024
1 parent 38eb6f0 commit 905aeed
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions suzieq/poller/controller/source/vcenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
import logging
from typing import Dict, List, Optional, Union
from urllib.parse import urlparse
from pyVim.connect import SmartConnect, Disconnect
from pyVmomi import vim, vmodl
import ssl
from pyVim.connect import Disconnect, SmartConnect
from pyVmomi import vim, vmodl


from pydantic import BaseModel, validator, Field

Expand Down Expand Up @@ -84,6 +85,9 @@ def validate_password(cls, password):


class Vcenter(Source, InventoryAsyncPlugin):
"""This class is used to dynamically retrieve the inventory
from Vcenter
"""
def __init__(self, config_data: dict, validate: bool = True) -> None:
self._status = 'init'
self._server: VcenterServerModel = None
Expand Down Expand Up @@ -208,7 +212,15 @@ async def get_inventory_list(self) -> List:
f'Vcenter: Retrieved {len(vms_with_ip)} VMs with IPs')
return vms_with_ip

def parse_inventory(self, inventory_list: list) -> Dict:
def parse_inventory(self, inventory_list: dict) -> Dict:
"""parse the raw inventory collected from the server and generates
a new inventory with only the required information.
Args:
raw_inventory: raw inventory received from vcenter.
Returns: A dict containing the inventory.
"""
inventory = {}
for name, ip in inventory_list.items():
namespace = self._namespace
Expand Down

0 comments on commit 905aeed

Please sign in to comment.