Skip to content

Commit

Permalink
Revert sample path.
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhijith Dadaga Arkakeerthy committed Jun 22, 2024
1 parent 7c7352f commit f2821a5
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 19 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ This can be done by setting the environment variable `PM_CONF_FILE` to the
custom config file path as shown below.

```bash
export PM_CONF_FILE=docs/sample/pm.config.yaml
export PM_CONF_FILE=sample/pm.config.yaml
```

The config file could be either a `yaml` or a `json` file.
Expand All @@ -139,7 +139,7 @@ $ cat pm.config.yaml
---
PluginManager:
# `library` is the location where plugin directories containing plugins are expected to be present
library: "./docs/sample/library"
library: "./sample/library"
log dir: "./"
# `log file` indicates the name of the log file.
# The timestamp and '.log' extension would be appended to this name.
Expand Down Expand Up @@ -200,7 +200,7 @@ where
### Example: Plugin Manager (PM) `run -plugins`
```json
$ jq -n "$plugins" | tee docs/sample/plugins-prereboot.json
$ jq -n "$plugins" | tee sample/plugins-prereboot.json
{
"Plugins": [
{
Expand Down Expand Up @@ -263,7 +263,7 @@ bash-5.1$
#### Specify `-plugins` details via json file
```bash
$ $GOBIN/pm run -plugins "./docs/sample/plugins-prereboot.json" -library docs/sample/library/
$ $GOBIN/pm run -plugins "./sample/plugins-prereboot.json" -library sample/library/
Applying "C" settings...: Starting
Applying "B" settings...: Starting
Applying "C" settings...: Succeeded
Expand Down Expand Up @@ -328,7 +328,7 @@ To override the values in the PM configuration, specify one or many of the
following optional arguments: `library`, `log-dir` and `log-file`
```bash
$ $GOBIN/pm run -type postreboot -library=docs/sample/library/ -log-dir=testlogs/ -log-file=test.log
$ $GOBIN/pm run -type postreboot -library=sample/library/ -log-dir=testlogs/ -log-file=test.log
Log: pm.2019-07-12T15:39:08.1145946-07:00.log
Log: testlogs/test.2019-07-12T15:39:08.1209416-07:00.log
Expand All @@ -343,7 +343,7 @@ $
### Example: Writing plugins result to a `output-file` in `output-format` {json, yaml} format
```bash
$ $GOBIN/pm run -type preupgrade -output-format=json -output-file=a.json -library ./docs/sample/library/
$ $GOBIN/pm run -type preupgrade -output-format=json -output-file=a.json -library ./sample/library/
Log: /var/log/asum/pm.2021-01-29T17:46:57.6904918-08:00.log
Checking for "D" settings...: Starting
Expand All @@ -369,7 +369,7 @@ $ cat a.json
],
"Requires": null,
"Status": "Succeeded",
"StdOutErr": "Running preupgrade.sh (path: docs/sample/library//D/preupgrade.sh) with status(0)...\nDisplaying Plugin Manager (PM) Config file path: \nDone(0)!\n"
"StdOutErr": "Running preupgrade.sh (path: sample/library//D/preupgrade.sh) with status(0)...\nDisplaying Plugin Manager (PM) Config file path: \nDone(0)!\n"
},
{
"Description": "Checking for \"A\" settings",
Expand All @@ -389,7 +389,7 @@ $ cat a.json
```
```bash
$ $GOBIN/pm run -type preupgrade -output-format=yaml -output-file=a.yaml -library ./docs/sample/library/
$ $GOBIN/pm run -type preupgrade -output-format=yaml -output-file=a.yaml -library ./sample/library/
Log: /var/log/asum/pm.2021-01-29T17:53:15.8128937-08:00.log
Checking for "D" settings...: Starting
Expand All @@ -409,7 +409,7 @@ plugins:
- A/a.preupgrade
requires: []
status: Failed
stdouterr: "Running preupgrade.sh (path: docs/sample/library//D/preupgrade.sh) with
stdouterr: "Running preupgrade.sh (path: sample/library//D/preupgrade.sh) with
status(1)...\nDisplaying Plugin Manager (PM) Config file path: \nFail(1)\n"
status: Failed
stdouterr: 'Running preupgrade plugins: Failed'
Expand Down
2 changes: 1 addition & 1 deletion cmd/pm/integ_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func setIntegrationEnvironment(topPath string) string {
configFile := filepath.FromSlash(topPath + "/pm.config-integ.yaml")

var newConfig Config
newConfig.PluginManager.Library = filepath.FromSlash(topPath + "/docs/sample/library")
newConfig.PluginManager.Library = filepath.FromSlash(topPath + "/sample/library")
newConfig.PluginManager.LogDir = filepath.FromSlash(topPath)
newConfig.PluginManager.LogFile = "pm-integ"

Expand Down
10 changes: 5 additions & 5 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ func Test_Load(t *testing.T) {
{
name: "Valid pm.config file",
args: args{
EnvConfFile: "../docs/sample/pm.config.yaml",
EnvConfFile: "../sample/pm.config.yaml",
},
want: Config{
PluginManager: struct {
Library string "yaml:\"library\""
LogDir string "yaml:\"log dir\""
LogFile string "yaml:\"log file\""
}{
Library: "../docs/sample/library",
Library: "../sample/library",
LogDir: "./",
LogFile: "pm",
},
Expand Down Expand Up @@ -127,15 +127,15 @@ func Test_readConfigFile(t *testing.T) {
{
name: "Valid conf file",
args: args{
confFilePath: "../docs/sample/pm.config.yaml",
confFilePath: "../sample/pm.config.yaml",
},
want: Config{
PluginManager: struct {
Library string "yaml:\"library\""
LogDir string "yaml:\"log dir\""
LogFile string "yaml:\"log file\""
}{
Library: "../docs/sample/library",
Library: "../sample/library",
LogDir: "./",
LogFile: "pm",
},
Expand All @@ -159,7 +159,7 @@ func Test_readConfigFile(t *testing.T) {
{
name: "Invalid conf file",
args: args{
confFilePath: "../../docs/sample/library/D/preupgrade.sh",
confFilePath: "../../sample/library/D/preupgrade.sh",
},
want: Config{
PluginManager: struct {
Expand Down
4 changes: 2 additions & 2 deletions plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func Test_getPluginFiles(t *testing.T) {
myConfigFile := os.Getenv(config.EnvConfFile)
if myConfigFile == "" {
// For case, where tests are run through IDE.
myConfigFile = filepath.FromSlash("./docs/sample/pm.config.yaml")
myConfigFile = filepath.FromSlash("./sample/pm.config.yaml")
}
wd, _ := os.Getwd()
t.Logf("PWD: %s;\nConfig file: %+v\n", wd, myConfigFile)
Expand Down Expand Up @@ -996,7 +996,7 @@ func Test_getPluginsInfoFromJSONStrOrFile(t *testing.T) {
},
{
name: "Plugins in JSON file",
args: args{jsonStrOrFile: "./docs/sample/plugins-prereboot.json"},
args: args{jsonStrOrFile: "./sample/plugins-prereboot.json"},
want: RunStatus{
Plugins: Plugins{
{
Expand Down
2 changes: 1 addition & 1 deletion sample/pm.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) 2020 Veritas Technologies LLC. All rights reserved. IP63-2828-7171-04-15-9
pluginmanager:
# `library` is the location where plugins directories containing plugins are expected to be present
library: "../docs/sample/library"
library: "../sample/library"
log dir: "./"
# `log file` indicates the name of the log file.
# The timestamp and '.log' extension would be appended to this name.
Expand Down
1 change: 0 additions & 1 deletion sample/pm.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Copyright (c) 2024 Veritas Technologies LLC. All rights reserved. IP63-2828-7171-04-15-9

# A python library for invoking Plugin Manager (PM) to run plugins in parallel while specifying dependencies between plugins.
# Additional details can be found here: https://stash.veritas.com/projects/AS/repos/vxos-common-rpms/browse/compiled_rpms/asum/plugin-manager/docs/pm.md

import logging
import os
Expand Down

0 comments on commit f2821a5

Please sign in to comment.