Skip to content

Commit

Permalink
revert 5308ab1 (#788)
Browse files Browse the repository at this point in the history
revert Blind commit to fix laconic CLI calls after rename. (#784)

`laconic cns` got renamed to `laconic registry` which breaks all the scripts and commands that use it.

Reviewed-on: https://git.vdb.to/cerc-io/stack-orchestrator/pulls/784
Co-authored-by: Thomas E Lackey <[email protected]>
Co-committed-by: Thomas E Lackey <[email protected]>

Reviewed-on: https://git.vdb.to/cerc-io/stack-orchestrator/pulls/788
  • Loading branch information
Thomas E Lackey committed Mar 27, 2024
1 parent 44faf36 commit d2442bc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if [ -n "$CERC_SCRIPT_DEBUG" ]; then
set -x
fi

registry_command="laconic registry"
registry_command="laconic cns"
demo_records_dir="scripts/demo-records"

# Check we have funds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ $ laconic-so --stack fixturenet-laconic-loaded deploy logs
```
## 6. Test with the Registry CLI
```
$ laconic-so --stack fixturenet-laconic-loaded deploy exec cli "laconic registry status"
$ laconic-so --stack fixturenet-laconic-loaded deploy exec cli "laconic cns status"
```
## 7. View the laconic console
Get the URL for the console web app with this command (the port number will be different for each deployment):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ $ laconic-so --stack fixturenet-laconicd deploy logs
```
## 6. Test with the Registry CLI
```
$ laconic-so --stack fixturenet-laconicd deploy exec cli "laconic registry status"
$ laconic-so --stack fixturenet-laconicd deploy exec cli "laconic cns status"
```
13 changes: 6 additions & 7 deletions stack_orchestrator/deploy/webapp/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def __init__(self, config_file, log_file=None):
)

def list_records(self, criteria={}, all=False):
args = ["laconic", "-c", self.config_file, "registry", "record", "list"]
args = ["laconic", "-c", self.config_file, "cns", "record", "list"]

if all:
args.append("--all")
Expand Down Expand Up @@ -140,7 +140,7 @@ def resolve(self, name):
if name in self.cache.name_or_id:
return self.cache.name_or_id[name]

args = ["laconic", "-c", self.config_file, "registry", "name", "resolve", name]
args = ["laconic", "-c", self.config_file, "cns", "name", "resolve", name]

parsed = [AttrDict(r) for r in json.loads(logged_cmd(self.log_file, *args))]
if parsed:
Expand All @@ -165,7 +165,7 @@ def get_record(self, name_or_id, require=False):
"laconic",
"-c",
self.config_file,
"registry",
"cns",
"record",
"get",
"--id",
Expand Down Expand Up @@ -203,8 +203,7 @@ def publish(self, record, names=[]):
print(open(record_fname, 'r').read(), file=self.log_file)

new_record_id = json.loads(
logged_cmd(self.log_file, "laconic", "-c", self.config_file, "registry",
"record", "publish", "--filename", record_fname)
logged_cmd(self.log_file, "laconic", "-c", self.config_file, "cns", "record", "publish", "--filename", record_fname)
)["id"]
for name in names:
self.set_name(name, new_record_id)
Expand All @@ -213,10 +212,10 @@ def publish(self, record, names=[]):
logged_cmd(self.log_file, "rm", "-rf", tmpdir)

def set_name(self, name, record_id):
logged_cmd(self.log_file, "laconic", "-c", self.config_file, "registry", "name", "set", name, record_id)
logged_cmd(self.log_file, "laconic", "-c", self.config_file, "cns", "name", "set", name, record_id)

def delete_name(self, name):
logged_cmd(self.log_file, "laconic", "-c", self.config_file, "registry", "name", "delete", name)
logged_cmd(self.log_file, "laconic", "-c", self.config_file, "cns", "name", "delete", name)


def file_hash(filename):
Expand Down

0 comments on commit d2442bc

Please sign in to comment.