mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 04:40:22 -07:00
Legacy pep8 clean fixes for contrib and hacking (#21081)
This commit is contained in:
parent
0de96d68f6
commit
5942de603d
10 changed files with 49 additions and 40 deletions
|
@ -58,7 +58,8 @@ class MDTInventory(object):
|
|||
Connect to MDT and dump contents of dbo.ComputerIdentity database
|
||||
'''
|
||||
if not self.conn:
|
||||
self.conn = pymssql.connect(server=self.mdt_server + "\\" + self.mdt_instance, user=self.mdt_user, password=self.mdt_password, database=self.mdt_database)
|
||||
self.conn = pymssql.connect(server=self.mdt_server + "\\" + self.mdt_instance, user=self.mdt_user, password=self.mdt_password,
|
||||
database=self.mdt_database)
|
||||
cursor = self.conn.cursor()
|
||||
cursor.execute(query)
|
||||
self.mdt_dump = cursor.fetchall()
|
||||
|
@ -69,7 +70,8 @@ class MDTInventory(object):
|
|||
Gets host from MDT Database
|
||||
'''
|
||||
if hostname:
|
||||
query = "SELECT t1.ID, t1.Description, t1.MacAddress, t2.Role FROM ComputerIdentity as t1 join Settings_Roles as t2 on t1.ID = t2.ID where t1.Description = '%s'" % hostname
|
||||
query = ("SELECT t1.ID, t1.Description, t1.MacAddress, t2.Role "
|
||||
"FROM ComputerIdentity as t1 join Settings_Roles as t2 on t1.ID = t2.ID where t1.Description = '%s'" % hostname)
|
||||
else:
|
||||
query = 'SELECT t1.ID, t1.Description, t1.MacAddress, t2.Role FROM ComputerIdentity as t1 join Settings_Roles as t2 on t1.ID = t2.ID'
|
||||
self._connect(query)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue