Skip to content

Commit 86f9570

Browse files
devaguptjettero
authored andcommitted
Changes for windows 4.0 release
1 parent 4eac006 commit 86f9570

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

pkg/hook-salt.py

+5-11
Original file line numberDiff line numberDiff line change
@@ -90,20 +90,14 @@
9090
binaries = BINARIES
9191

9292
def _patch_salt_grains_core_server_id():
93-
import subprocess
9493
import salt.config # must import before salt.grains.core
9594
import salt.grains.core
9695
import sys
96+
import patch
9797

98-
with open('pkg/salt.grains.core.patch', 'rb') as fh:
99-
patch_data = fh.read()
100-
101-
process = subprocess.Popen(['patch',
102-
'--forward', # ignore patches that appear reversed or already applied
103-
'--batch', # ask no questions
104-
salt.grains.core.__file__],
105-
stdin=subprocess.PIPE)
106-
stdout, stderr = process.communicate(patch_data)
98+
pset = patch.fromfile('pkg/salt.grains.core.patch')
99+
pset.items[0].target=salt.grains.core.__file__.encode()
100+
pset.apply()
107101
sys.stderr.write('patching complete\n')
108102

109-
_patch_salt_grains_core_server_id()
103+
_patch_salt_grains_core_server_id()

pkg/salt.grains.core.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
+
3131
+ import hashlib
3232
+ md5 = hashlib.md5()
33-
+ md5.update( f'{id_}'.encode() )
33+
+ md5.update( str(id_).encode() )
3434
+ id_hash = int( md5.hexdigest(), 16 )
3535
if id_hash is None:
3636
# Python < 3.3 or error encountered above

0 commit comments

Comments
 (0)