From c92add95b57578649b5429c75cb519aa35775780 Mon Sep 17 00:00:00 2001 From: twangboy Date: Tue, 4 Aug 2015 09:01:45 -0600 Subject: [PATCH] Gated ctypes import, fixed some lint --- salt/modules/win_system.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/salt/modules/win_system.py b/salt/modules/win_system.py index cee8500cc6..33670a0fa4 100644 --- a/salt/modules/win_system.py +++ b/salt/modules/win_system.py @@ -11,7 +11,6 @@ from __future__ import absolute_import # Import python libs import logging -from ctypes import windll from datetime import datetime # Import 3rd Party Libs @@ -19,6 +18,7 @@ try: import win32net import win32api import pywintypes + from ctypes import windll HAS_WIN32NET_MODS = True except ImportError: HAS_WIN32NET_MODS = False @@ -273,7 +273,7 @@ def get_pending_computer_name(): ''' current = get_computer_name() pending = read_value('HKLM', - 'SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName', + r'SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName', 'ComputerName')['vdata'] if pending: return pending if pending != current else None