In this changes added support Windows Server 2012 - #56
Conversation
s3inlc
left a comment
There was a problem hiding this comment.
Thanks for your PR, I looked through the code and requested some changes regarding the code. Unfortunately I myself don't have a Windows Server setup to test on (neither a normal Windows setup to test if nothing existing breaks), so I may need a bit of time to have other people test it on their setup.
| def __init__(self): | ||
| self.config = Config() | ||
| # In windows server and windows server R2 uses cp1251 encoding | ||
| self.encoding = "utf-8" |
There was a problem hiding this comment.
why does this need to be set as variable here when the only place where it is used is where 'utf-8' was already enforced there? Or how is this supposed to be changed on the class?
| processor_information = subprocess.check_output( | ||
| 'powershell -Command "Get-CimInstance Win32_Processor | Select-Object -ExpandProperty Name"', | ||
| shell=True) | ||
| 'powershell -Command "Get-CimInstance Win32_Processor | Select-Object -ExpandProperty Name"', |
There was a problem hiding this comment.
this indentation is inconsistent with the other parts where the subprocess commands are called (indented twice instead of just once)
| shell=True) | ||
| processor_information = self.decode_output(processor_information) | ||
| video_controller = subprocess.check_output('wmic path win32_VideoController get name', shell=True) | ||
| 'powershell -Command "Get-CimInstance Win32_VideoController | Select-Object -ExpandProperty Name"', |
There was a problem hiding this comment.
this indentation is inconsistent with the other parts where the subprocess commands are called (indented twice instead of just once)
| line = line.rstrip("\r\n ") | ||
| if line and line != "Name": | ||
| devices.append(line) | ||
|
|
There was a problem hiding this comment.
this empty line helps for code readability, i.e. the section between linux and windows also is separated with an empty line, so it should remain also for consistency.
During the time of working with your wonderful development I encountered the problem that your agent does not start on a PC with Windows Server 2012 and Windows Server 2012 r2 OS