Skip to content

Commit 24e4410

Browse files
committed
Fix pylint
Signed-off-by: Tushar <tgupta3@users.noreply.github.com>
1 parent 4f79191 commit 24e4410

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

suzieq/poller/controller/source/vcenter.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
import logging
1111
from typing import Dict, List, Optional, Union
1212
from urllib.parse import urlparse
13-
from pyVim.connect import SmartConnect, Disconnect
14-
from pyVmomi import vim, vmodl
1513
import ssl
14+
from pyVim.connect import Disconnect, SmartConnect
15+
from pyVmomi import vim, vmodl
16+
1617

1718
from pydantic import BaseModel, validator, Field
1819

@@ -84,6 +85,9 @@ def validate_password(cls, password):
8485

8586

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

211-
def parse_inventory(self, inventory_list: list) -> Dict:
215+
def parse_inventory(self, inventory_list: dict) -> Dict:
216+
"""parse the raw inventory collected from the server and generates
217+
a new inventory with only the required information.
218+
219+
Args:
220+
raw_inventory: raw inventory received from vcenter.
221+
222+
Returns: A dict containing the inventory.
223+
"""
212224
inventory = {}
213225
for name, ip in inventory_list.items():
214226
namespace = self._namespace

0 commit comments

Comments
 (0)