Skip to content

Commit

Permalink
Add a command to clear the service database
Browse files Browse the repository at this point in the history
Add a pdo-shell command to clear the service database. When
building the test databases, the default values for some of
the groups persisted.

Signed-off-by: Mic Bowman <mic.bowman@intel.com>
  • Loading branch information
cmickeyb authored and prakashngit committed Sep 26, 2023
1 parent 379ef42 commit 328f322
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
3 changes: 3 additions & 0 deletions client/bin/pdo-create-service-groups.psh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ fi

echo create groups for ${service_host} in ${group_file}

## Remove any groups previously defined
service_groups clear

## -----------------------------------------------------------------
## Set the default set of eservices that this file knows
## about. There may be more that have been added to the
Expand Down
18 changes: 17 additions & 1 deletion client/pdo/client/commands/service_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
'script_command_load',
'script_command_save',
'script_command_list',
'script_command_clear',
'do_service_groups',
'load_commands',
]
Expand Down Expand Up @@ -149,13 +150,28 @@ def invoke(cls, state, bindings, **kwargs) :

return True

## -----------------------------------------------------------------
## -----------------------------------------------------------------
class script_command_clear(pscript.script_command_base) :
name = "clear"
help = "Clear all information in the service groups database"

@classmethod
def invoke(cls, state, bindings, **kwargs) :
state.set(['Service', 'ProvisioningServiceGroups'], {})
state.set(['Service', 'StorageServiceGroups'], {})
state.set(['Service', 'EnclaveServiceGroups'], {})

return True

## -----------------------------------------------------------------
## Create the generic, shell independent version of the aggregate command
## -----------------------------------------------------------------
__subcommands__ = [
script_command_load,
script_command_save,
script_command_list
script_command_list,
script_command_clear,
]
do_service_groups = pscript.create_shell_command('service_groups', __subcommands__)

Expand Down

0 comments on commit 328f322

Please sign in to comment.