mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-03 20:31:35 +00:00
Two fixes
Updated multiprocessing to handle the following error that occurs on MacOS when a `gam csv` command is interrupted with a contol-C. ``` multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be N leaked semaphore objects to clean up at shutdown ``` Fixed bug in `gam print crostelemetry` that caused a trap: `KeyError: 'reportTime'`.
This commit is contained in:
@@ -10,6 +10,16 @@ Add the `-s` option to the end of the above commands to suppress creating the `g
|
|||||||
|
|
||||||
See [Downloads](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads) for Windows or other options, including manual installation
|
See [Downloads](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads) for Windows or other options, including manual installation
|
||||||
|
|
||||||
|
### 6.65.10
|
||||||
|
|
||||||
|
Updated multiprocessing to handle the following error that occurs on MacOS when a `gam csv` command
|
||||||
|
is interrupted with a contol-C.
|
||||||
|
```
|
||||||
|
multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be N leaked semaphore objects to clean up at shutdown
|
||||||
|
```
|
||||||
|
|
||||||
|
Fixed bug in `gam print crostelemetry` that caused a trap: `KeyError: 'reportTime'`.
|
||||||
|
|
||||||
### 6.65.09
|
### 6.65.09
|
||||||
|
|
||||||
Added option `noduplicate` to `gam <UserTypeEntity> create drivefile` that causes GAM
|
Added option `noduplicate` to `gam <UserTypeEntity> create drivefile` that causes GAM
|
||||||
|
|||||||
@@ -334,7 +334,7 @@ writes the credentials into the file oauth2.txt.
|
|||||||
admin@server:/Users/admin/bin/gamadv-xtd3$ rm -f /Users/admin/GAMConfig/oauth2.txt
|
admin@server:/Users/admin/bin/gamadv-xtd3$ rm -f /Users/admin/GAMConfig/oauth2.txt
|
||||||
admin@server:/Users/admin/bin/gamadv-xtd3$ ./gam version
|
admin@server:/Users/admin/bin/gamadv-xtd3$ ./gam version
|
||||||
WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found
|
WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found
|
||||||
GAMADV-XTD3 6.65.09 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
GAMADV-XTD3 6.65.10 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.10.8 64-bit final
|
Python 3.10.8 64-bit final
|
||||||
MacOS High Sierra 10.13.6 x86_64
|
MacOS High Sierra 10.13.6 x86_64
|
||||||
@@ -1002,7 +1002,7 @@ writes the credentials into the file oauth2.txt.
|
|||||||
C:\GAMADV-XTD3>del C:\GAMConfig\oauth2.txt
|
C:\GAMADV-XTD3>del C:\GAMConfig\oauth2.txt
|
||||||
C:\GAMADV-XTD3>gam version
|
C:\GAMADV-XTD3>gam version
|
||||||
WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found
|
WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found
|
||||||
GAMADV-XTD3 6.65.09 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
GAMADV-XTD3 6.65.10 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.0 64-bit final
|
Python 3.12.0 64-bit final
|
||||||
Windows-10-10.0.17134 AMD64
|
Windows-10-10.0.17134 AMD64
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
Print the current version of Gam with details
|
Print the current version of Gam with details
|
||||||
```
|
```
|
||||||
gam version
|
gam version
|
||||||
GAMADV-XTD3 6.65.09 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
GAMADV-XTD3 6.65.10 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.0 64-bit final
|
Python 3.12.0 64-bit final
|
||||||
MacOS Monterey 12.7 x86_64
|
MacOS Monterey 12.7 x86_64
|
||||||
@@ -16,7 +16,7 @@ Time: 2023-06-02T21:10:00-07:00
|
|||||||
Print the current version of Gam with details and time offset information
|
Print the current version of Gam with details and time offset information
|
||||||
```
|
```
|
||||||
gam version timeoffset
|
gam version timeoffset
|
||||||
GAMADV-XTD3 6.65.09 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
GAMADV-XTD3 6.65.10 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.0 64-bit final
|
Python 3.12.0 64-bit final
|
||||||
MacOS Monterey 12.7 x86_64
|
MacOS Monterey 12.7 x86_64
|
||||||
@@ -28,7 +28,7 @@ Your system time differs from www.googleapis.com by less than 1 second
|
|||||||
Print the current version of Gam with extended details and SSL information
|
Print the current version of Gam with extended details and SSL information
|
||||||
```
|
```
|
||||||
gam version extended
|
gam version extended
|
||||||
GAMADV-XTD3 6.65.09 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
GAMADV-XTD3 6.65.10 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.0 64-bit final
|
Python 3.12.0 64-bit final
|
||||||
MacOS Monterey 12.7 x86_64
|
MacOS Monterey 12.7 x86_64
|
||||||
@@ -65,7 +65,7 @@ MacOS High Sierra 10.13.6 x86_64
|
|||||||
Path: /Users/Admin/bin/gamadv-xtd3
|
Path: /Users/Admin/bin/gamadv-xtd3
|
||||||
Version Check:
|
Version Check:
|
||||||
Current: 5.35.08
|
Current: 5.35.08
|
||||||
Latest: 6.65.09
|
Latest: 6.65.10
|
||||||
echo $?
|
echo $?
|
||||||
1
|
1
|
||||||
```
|
```
|
||||||
@@ -73,7 +73,7 @@ echo $?
|
|||||||
Print the current version number without details
|
Print the current version number without details
|
||||||
```
|
```
|
||||||
gam version simple
|
gam version simple
|
||||||
6.65.09
|
6.65.10
|
||||||
```
|
```
|
||||||
In Linux/MacOS you can do:
|
In Linux/MacOS you can do:
|
||||||
```
|
```
|
||||||
@@ -83,7 +83,7 @@ echo $VER
|
|||||||
Print the current version of Gam and address of this Wiki
|
Print the current version of Gam and address of this Wiki
|
||||||
```
|
```
|
||||||
gam help
|
gam help
|
||||||
GAM 6.65.09 - https://github.com/taers232c/GAMADV-XTD3
|
GAM 6.65.10 - https://github.com/taers232c/GAMADV-XTD3
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.0 64-bit final
|
Python 3.12.0 64-bit final
|
||||||
MacOS Monterey 12.7 x86_64
|
MacOS Monterey 12.7 x86_64
|
||||||
|
|||||||
@@ -2,6 +2,16 @@
|
|||||||
|
|
||||||
Merged GAM-Team version
|
Merged GAM-Team version
|
||||||
|
|
||||||
|
6.65.10
|
||||||
|
|
||||||
|
Updated multiprocessing to handle the following error that occurs on MacOS when a `gam csv` command
|
||||||
|
is interrupted with a contol-C.
|
||||||
|
```
|
||||||
|
multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be N leaked semaphore objects to clean up at shutdown
|
||||||
|
```
|
||||||
|
|
||||||
|
Fixed bug in `gam print crostelemetry` that caused a trap: `KeyError: 'reportTime'`.
|
||||||
|
|
||||||
6.65.09
|
6.65.09
|
||||||
|
|
||||||
Added option `noduplicate` to `gam <UserTypeEntity> create drivefile` that causes GAM
|
Added option `noduplicate` to `gam <UserTypeEntity> create drivefile` that causes GAM
|
||||||
|
|||||||
@@ -370,9 +370,6 @@ YUBIKEY_VALUE_ERROR_RC = 85
|
|||||||
YUBIKEY_MULTIPLE_CONNECTED_RC = 86
|
YUBIKEY_MULTIPLE_CONNECTED_RC = 86
|
||||||
YUBIKEY_NOT_FOUND_RC = 87
|
YUBIKEY_NOT_FOUND_RC = 87
|
||||||
|
|
||||||
# Multiprocessing lock
|
|
||||||
mplock = None
|
|
||||||
|
|
||||||
# stdin/stdout/stderr
|
# stdin/stdout/stderr
|
||||||
def readStdin(prompt):
|
def readStdin(prompt):
|
||||||
return input(prompt)
|
return input(prompt)
|
||||||
@@ -9421,7 +9418,7 @@ def terminateStdQueueHandler(mpQueue, mpQueueHandler):
|
|||||||
mpQueue.put((0, GM.REDIRECT_QUEUE_EOF, None))
|
mpQueue.put((0, GM.REDIRECT_QUEUE_EOF, None))
|
||||||
mpQueueHandler.join()
|
mpQueueHandler.join()
|
||||||
|
|
||||||
def ProcessGAMCommandMulti(pid, numItems, logCmd, mpQueueCSVFile, mpQueueStdout, mpQueueStderr,
|
def ProcessGAMCommandMulti(mplock, pid, numItems, logCmd, mpQueueCSVFile, mpQueueStdout, mpQueueStderr,
|
||||||
debugLevel, todrive, printAguDomains,
|
debugLevel, todrive, printAguDomains,
|
||||||
printCrosOUs, printCrosOUsAndChildren,
|
printCrosOUs, printCrosOUsAndChildren,
|
||||||
output_dateformat, output_timeformat,
|
output_dateformat, output_timeformat,
|
||||||
@@ -9432,8 +9429,6 @@ def ProcessGAMCommandMulti(pid, numItems, logCmd, mpQueueCSVFile, mpQueueStdout,
|
|||||||
csvRowFilter, csvRowFilterMode, csvRowDropFilter, csvRowDropFilterMode,
|
csvRowFilter, csvRowFilterMode, csvRowDropFilter, csvRowDropFilterMode,
|
||||||
csvRowLimit,
|
csvRowLimit,
|
||||||
args):
|
args):
|
||||||
global mplock
|
|
||||||
|
|
||||||
with mplock:
|
with mplock:
|
||||||
initializeLogging()
|
initializeLogging()
|
||||||
if sys.platform.startswith('win'):
|
if sys.platform.startswith('win'):
|
||||||
@@ -9528,10 +9523,6 @@ def checkChildProcessRC(rc):
|
|||||||
return not low <= rc <= high
|
return not low <= rc <= high
|
||||||
return low <= rc <= high
|
return low <= rc <= high
|
||||||
|
|
||||||
def initGamWorker(l):
|
|
||||||
global mplock
|
|
||||||
mplock = l
|
|
||||||
|
|
||||||
def MultiprocessGAMCommands(items, showCmds):
|
def MultiprocessGAMCommands(items, showCmds):
|
||||||
def poolCallback(result):
|
def poolCallback(result):
|
||||||
poolProcessResults[0] -= 1
|
poolProcessResults[0] -= 1
|
||||||
@@ -9554,12 +9545,12 @@ def MultiprocessGAMCommands(items, showCmds):
|
|||||||
parallelPoolProcesses = min(numItems, GC.Values[GC.MULTIPROCESS_POOL_LIMIT])
|
parallelPoolProcesses = min(numItems, GC.Values[GC.MULTIPROCESS_POOL_LIMIT])
|
||||||
origSigintHandler = signal.signal(signal.SIGINT, signal.SIG_IGN)
|
origSigintHandler = signal.signal(signal.SIGINT, signal.SIG_IGN)
|
||||||
mpManager = multiprocessing.Manager()
|
mpManager = multiprocessing.Manager()
|
||||||
l = mpManager.Lock()
|
mplock = mpManager.Lock()
|
||||||
try:
|
try:
|
||||||
if multiprocessing.get_start_method() == 'spawn':
|
if multiprocessing.get_start_method() == 'spawn':
|
||||||
pool = mpManager.Pool(processes=numPoolProcesses, initializer=initGamWorker, initargs=(l,), maxtasksperchild=200)
|
pool = mpManager.Pool(processes=numPoolProcesses, maxtasksperchild=200)
|
||||||
else:
|
else:
|
||||||
pool = multiprocessing.Pool(processes=numPoolProcesses, initializer=initGamWorker, initargs=(l,), maxtasksperchild=200)
|
pool = multiprocessing.Pool(processes=numPoolProcesses, maxtasksperchild=200)
|
||||||
except IOError as e:
|
except IOError as e:
|
||||||
systemErrorExit(FILE_ERROR_RC, e)
|
systemErrorExit(FILE_ERROR_RC, e)
|
||||||
except AssertionError as e:
|
except AssertionError as e:
|
||||||
@@ -9632,7 +9623,7 @@ def MultiprocessGAMCommands(items, showCmds):
|
|||||||
else:
|
else:
|
||||||
logCmd = ''
|
logCmd = ''
|
||||||
poolProcessResults[pid] = pool.apply_async(ProcessGAMCommandMulti,
|
poolProcessResults[pid] = pool.apply_async(ProcessGAMCommandMulti,
|
||||||
[pid, numItems, logCmd, mpQueueCSVFile, mpQueueStdout, mpQueueStderr,
|
[mplock, pid, numItems, logCmd, mpQueueCSVFile, mpQueueStdout, mpQueueStderr,
|
||||||
GC.Values[GC.DEBUG_LEVEL], GM.Globals[GM.CSV_TODRIVE],
|
GC.Values[GC.DEBUG_LEVEL], GM.Globals[GM.CSV_TODRIVE],
|
||||||
GC.Values[GC.PRINT_AGU_DOMAINS],
|
GC.Values[GC.PRINT_AGU_DOMAINS],
|
||||||
GC.Values[GC.PRINT_CROS_OUS], GC.Values[GC.PRINT_CROS_OUS_AND_CHILDREN],
|
GC.Values[GC.PRINT_CROS_OUS], GC.Values[GC.PRINT_CROS_OUS_AND_CHILDREN],
|
||||||
@@ -24012,8 +24003,11 @@ def doInfoPrintShowCrOSTelemetry():
|
|||||||
device[field] = []
|
device[field] = []
|
||||||
i = 0
|
i = 0
|
||||||
for item in listItems:
|
for item in listItems:
|
||||||
|
if 'reportTime' in item:
|
||||||
timeValue, _ = iso8601.parse_date(item['reportTime'])
|
timeValue, _ = iso8601.parse_date(item['reportTime'])
|
||||||
if ((startTime is None) or (timeValue >= startTime)) and ((endTime is None) or (timeValue <= endTime)):
|
else:
|
||||||
|
timeValue = None
|
||||||
|
if (timeValue is None) or (((startTime is None) or (timeValue >= startTime)) and ((endTime is None) or (timeValue <= endTime))):
|
||||||
device[field].append(item)
|
device[field].append(item)
|
||||||
i += 1
|
i += 1
|
||||||
if listLimit and i == listLimit:
|
if listLimit and i == listLimit:
|
||||||
|
|||||||
Reference in New Issue
Block a user