mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-03 20:31:35 +00:00
Added variables <RESearchPattern> to gam config|select verify
This commit is contained in:
@@ -1290,11 +1290,12 @@ Specify a collection of items by directly specifying them; the item type is dete
|
|||||||
|
|
||||||
## Select a section from gam.cfg and process a GAM command using values from that section
|
## Select a section from gam.cfg and process a GAM command using values from that section
|
||||||
<Select> ::=
|
<Select> ::=
|
||||||
select <Section> [save] [verify]
|
select <Section> [save] [verify [variables <RESearchPattern>]]
|
||||||
save
|
save
|
||||||
Set section = <Section> in the [DEFAULT] section and write configuration data to gam.cfg
|
Set section = <Section> in the [DEFAULT] section and write configuration data to gam.cfg
|
||||||
verify
|
verify
|
||||||
Print the variable values for the selected section
|
Print the variable values for the selected section
|
||||||
|
Use `variables <RESearchPattern>` to display variables with names selected by `<RESearchPattern>`
|
||||||
Values are determined in this order: Selected section, DEFAULT section, Program default
|
Values are determined in this order: Selected section, DEFAULT section, Program default
|
||||||
|
|
||||||
## Display all of the sections in gam.cfg and mark the currently selected section with a *.
|
## Display all of the sections in gam.cfg and mark the currently selected section with a *.
|
||||||
@@ -1318,7 +1319,7 @@ csv_input_row_drop_filter, csv_input_row_drop_filter_mode and csv_input_row_limi
|
|||||||
## Set variables in gam.cfg.
|
## Set variables in gam.cfg.
|
||||||
|
|
||||||
<Config> ::=
|
<Config> ::=
|
||||||
config (<VariableName> [=] <Value>)* [save] [verify]
|
config (<VariableName> [=] <Value>)* [save] [verify [variables <RESearchPattern>]]
|
||||||
<VariableName> [=] <Value>
|
<VariableName> [=] <Value>
|
||||||
Set <VariableName> = <Value> in the current section
|
Set <VariableName> = <Value> in the current section
|
||||||
All <VariableNames> except section are allowed.
|
All <VariableNames> except section are allowed.
|
||||||
@@ -1327,6 +1328,7 @@ save
|
|||||||
Write configuration data to gam.cfg
|
Write configuration data to gam.cfg
|
||||||
verify
|
verify
|
||||||
Print the variable values for the current section
|
Print the variable values for the current section
|
||||||
|
Use `variables <RESearchPattern>` to display variables with names selected by `<RESearchPattern>`.
|
||||||
Values are determined in this order: Current section, DEFAULT section, Program default
|
Values are determined in this order: Current section, DEFAULT section, Program default
|
||||||
|
|
||||||
## Terminate processing of a CSV or batch file when one of the subprocesses returns a matching return code.
|
## Terminate processing of a CSV or batch file when one of the subprocesses returns a matching return code.
|
||||||
|
|||||||
@@ -1,3 +1,23 @@
|
|||||||
|
7.31.05
|
||||||
|
|
||||||
|
Added option `variables <RESearchPattern>` to `gam select section <SectionName> verify` and `gam config verify`
|
||||||
|
that causes GAM to only display variables with names selected by `<RESearchPattern>`.
|
||||||
|
```
|
||||||
|
gam select School verify variables "^(customer|domain)"
|
||||||
|
Section: School
|
||||||
|
customer_id = C03abc123
|
||||||
|
domain = school.edu
|
||||||
|
|
||||||
|
gam config verify variables 'dir'
|
||||||
|
Section: DEFAULT
|
||||||
|
cache_dir = ~/GamConfig/gamcache ; /Users/gamteam/GamConfig/gamcache
|
||||||
|
config_dir = ~/GamConfig ; /Users/gamteam/GamConfig
|
||||||
|
drive_dir = ~/GamWork ; /Users/gamteam/GamWork
|
||||||
|
gmail_cse_incert_dir = ~/GmailCSE/Certs ; /Users/gamteam/GmailCSE/Certs
|
||||||
|
gmail_cse_inkey_dir = ~/GmailCSE/Keys ; /Users/gamteam/GmailCSE/Keys
|
||||||
|
input_dir = .
|
||||||
|
```
|
||||||
|
|
||||||
7.31.04
|
7.31.04
|
||||||
|
|
||||||
Fixed bug in `gam report admin|chrome` that caused to events to not be displayed.
|
Fixed bug in `gam report admin|chrome` that caused to events to not be displayed.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
# GAM7
|
# GAM7
|
||||||
#
|
#
|
||||||
# Copyright 2025, All Rights Reserved.
|
# Copyright 2026, All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
||||||
__version__ = '7.31.04'
|
__version__ = '7.31.05'
|
||||||
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
||||||
|
|
||||||
#pylint: disable=wrong-import-position
|
#pylint: disable=wrong-import-position
|
||||||
@@ -3831,9 +3831,12 @@ def SetGlobalVariables():
|
|||||||
stderrErrorMsg(fileErrorMessage(fileName, e, Ent.CONFIG_FILE))
|
stderrErrorMsg(fileErrorMessage(fileName, e, Ent.CONFIG_FILE))
|
||||||
|
|
||||||
def _verifyValues(sectionName, inputFilterSectionName, outputFilterSectionName):
|
def _verifyValues(sectionName, inputFilterSectionName, outputFilterSectionName):
|
||||||
|
itemNamePattern = getREPattern() if checkArgumentPresent('variables') else None
|
||||||
printKeyValueList([Ent.Singular(Ent.SECTION), sectionName]) # Do not use printEntity
|
printKeyValueList([Ent.Singular(Ent.SECTION), sectionName]) # Do not use printEntity
|
||||||
Ind.Increment()
|
Ind.Increment()
|
||||||
for itemName, itemEntry in GC.VAR_INFO.items():
|
for itemName, itemEntry in GC.VAR_INFO.items():
|
||||||
|
if itemNamePattern and not itemNamePattern.search(itemName):
|
||||||
|
continue
|
||||||
sectName = sectionName
|
sectName = sectionName
|
||||||
if itemName in GC.CSV_INPUT_ROW_FILTER_ITEMS:
|
if itemName in GC.CSV_INPUT_ROW_FILTER_ITEMS:
|
||||||
if inputFilterSectionName:
|
if inputFilterSectionName:
|
||||||
@@ -4014,7 +4017,7 @@ def SetGlobalVariables():
|
|||||||
usageErrorExit(formatKeyValueList('', [EV_GAMCFGSECTION, sectionName, 'select', Msg.NOT_ALLOWED], ''))
|
usageErrorExit(formatKeyValueList('', [EV_GAMCFGSECTION, sectionName, 'select', Msg.NOT_ALLOWED], ''))
|
||||||
else:
|
else:
|
||||||
sectionName = _getCfgSection(configparser.DEFAULTSECT, GC.SECTION)
|
sectionName = _getCfgSection(configparser.DEFAULTSECT, GC.SECTION)
|
||||||
# select <SectionName> [save] [verify]
|
# select <SectionName> [save] [verify [variables <RESearchPattern>]]
|
||||||
if checkArgumentPresent(Cmd.SELECT_CMD):
|
if checkArgumentPresent(Cmd.SELECT_CMD):
|
||||||
sectionName = _selectSection()
|
sectionName = _selectSection()
|
||||||
GM.Globals[GM.SECTION] = sectionName # Save section for inner gams
|
GM.Globals[GM.SECTION] = sectionName # Save section for inner gams
|
||||||
@@ -4065,7 +4068,7 @@ def SetGlobalVariables():
|
|||||||
if GM.Globals[GM.PARSER].has_option(section, GC.CMDLOG_MAX__BACKUPS):
|
if GM.Globals[GM.PARSER].has_option(section, GC.CMDLOG_MAX__BACKUPS):
|
||||||
GM.Globals[GM.PARSER].set(section, GC.CMDLOG_MAX_BACKUPS, GM.Globals[GM.PARSER].get(section, GC.CMDLOG_MAX__BACKUPS))
|
GM.Globals[GM.PARSER].set(section, GC.CMDLOG_MAX_BACKUPS, GM.Globals[GM.PARSER].get(section, GC.CMDLOG_MAX__BACKUPS))
|
||||||
GM.Globals[GM.PARSER].remove_option(section, GC.CMDLOG_MAX__BACKUPS)
|
GM.Globals[GM.PARSER].remove_option(section, GC.CMDLOG_MAX__BACKUPS)
|
||||||
# config (<VariableName> [=] <Value>)* [save] [verify]
|
# config (<VariableName> [=] <Value>)* [save] [verify [variables <RESearchPattern>]]
|
||||||
if checkArgumentPresent(Cmd.CONFIG_CMD):
|
if checkArgumentPresent(Cmd.CONFIG_CMD):
|
||||||
while Cmd.ArgumentsRemaining():
|
while Cmd.ArgumentsRemaining():
|
||||||
if checkArgumentPresent('save'):
|
if checkArgumentPresent('save'):
|
||||||
|
|||||||
Reference in New Issue
Block a user