Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ssorj committed Jun 18, 2024
1 parent 67afa51 commit 3527506
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 31 deletions.
11 changes: 5 additions & 6 deletions config/commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ standard_options:
description: |
Display help and exit.
groups:
- name: Sites
- name: Site configuration
commands:
- name: site
description: |
Expand Down Expand Up @@ -145,6 +145,7 @@ groups:
options:
- name: name
type: string
required: false
positional: true
description: |
The name of the site resource.
Expand Down Expand Up @@ -179,10 +180,7 @@ groups:
resource: Grant
related_commands: ["token redeem"]
description: |
Issue a token redeemable for a link to the current site.
Issue a token that can be redeemed at a remote site for a
link to the current site.
Issue a token file redeemable for a link to the current site.
This command first creates a grant in order to issue the
token.
Expand Down Expand Up @@ -223,7 +221,8 @@ groups:
- name: token redeem
related_commands: ["token issue"]
description: |
Redeem a token in order to create a link to a remote site.
Redeem a token file in order to create a link to a remote
site.
usage: skupper token redeem <file> [options]
output: |
Waiting for status...
Expand Down
2 changes: 1 addition & 1 deletion config/resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ standard_properties:
description: |
This thing is working.
groups:
- name: Sites
- name: Site configuration
resources:
- name: Site
related_concepts: [network, namespace]
Expand Down
6 changes: 3 additions & 3 deletions input/commands/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ links:

# Skupper commands

#### Sites
#### Site configuration

| | |
|-|-|
Expand All @@ -23,8 +23,8 @@ links:
| | |
|-|-|
| [token](token.html) | Display help for token commands and exit |
| [token issue](token-issue.html) | Issue a token redeemable for a link to the current site |
| [token redeem](token-redeem.html) | Redeem a token in order to create a link to a remote site |
| [token issue](token-issue.html) | Issue a token file redeemable for a link to the current site |
| [token redeem](token-redeem.html) | Redeem a token file in order to create a link to a remote site |
| [link](link.html) | Display help for link commands and exit |
| [link create](link-create.html) | Create a link |
| [link update](link-update.html) | Change link settings |
Expand Down
2 changes: 1 addition & 1 deletion input/commands/site-delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Site "<name>" is deleted.

## Options

- <h3 id="name">name <span class="option-info">string, required</span></h3>
- <h3 id="name">name <span class="option-info">string, optional</span></h3>

The name of the site resource.

Expand Down
5 changes: 1 addition & 4 deletions input/commands/token-issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ links:

<section>

Issue a token redeemable for a link to the current site.

Issue a token that can be redeemed at a remote site for a
link to the current site.
Issue a token file redeemable for a link to the current site.

This command first creates a grant in order to issue the
token.
Expand Down
3 changes: 2 additions & 1 deletion input/commands/token-redeem.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ links:

<section>

Redeem a token in order to create a link to a remote site.
Redeem a token file in order to create a link to a remote
site.

</section>

Expand Down
2 changes: 1 addition & 1 deletion input/resources/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ links:

# Skupper resources

#### Sites
#### Site configuration

| | |
|-|-|
Expand Down
4 changes: 2 additions & 2 deletions python/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ def merge_option_data(self):
if name not in standard_option_data:
fail(f"Option '{name}' not in standard options")

# XXX Duplicates!
option_names = list(specific_option_data.keys()) + inherited_options
option_names = list(specific_option_data.keys()) + \
[x for x in inherited_options if x not in specific_option_data]
option_data = dict()

for name in option_names:
Expand Down
8 changes: 4 additions & 4 deletions python/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def related_concepts(self):
try:
yield self.model.concept_model.concepts_by_name[name]
except KeyError:
raise # XXX An error message!
fail(f"Related concept '{name}' on {self} not found")

@property
def related_resources(self):
Expand All @@ -190,7 +190,7 @@ def related_resources(self):
try:
yield self.model.resource_model.resources_by_name[name]
except KeyError:
raise # XXX An error message!
fail(f"Related resource '{name}' on {self} not found")

@property
def related_commands(self):
Expand All @@ -206,7 +206,7 @@ def related_commands(self):
try:
yield self.model.command_model.commands_by_name[name]
except KeyError:
raise # XXX An error message!
fail(f"Related command '{name}' on {self} not found")

class ModelObjectAttribute:
hidden = object_property("hidden", default=False)
Expand Down Expand Up @@ -241,4 +241,4 @@ def related_concepts(self):
try:
yield self.model.concept_model.concepts_by_name[name]
except KeyError:
raise # XXX An error message!
fail(f"Related concept '{name}' on {self} not found")
9 changes: 1 addition & 8 deletions python/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ def append(line=""):
append()

for group in model.groups:
# XXX
if "stuff" in group.name:
continue

append(f"#### {group.name}")
append()
append("| | |")
Expand Down Expand Up @@ -96,7 +92,6 @@ def append(line=""):
append()

for example in resource.examples:
# XXX An example object
append(example["description"].strip() + ":")
append()
append("~~~ yaml")
Expand Down Expand Up @@ -185,8 +180,6 @@ def generate_property(prop, append):
append(" </section>")
append()

# return "\n".join(lines)

class ResourceModel:
def __init__(self):
debug(f"Loading {self}")
Expand Down Expand Up @@ -308,7 +301,7 @@ def merge_property_data(self, section):
if name not in standard_prop_data:
fail(f"Property '{name}' not in standard properties")

prop_names = list(specific_prop_data.keys()) + inherited_props
prop_names = list(specific_prop_data.keys()) + [x for x in inherited_props if x not in specific_prop_data]
prop_data = dict()

for name in prop_names:
Expand Down

0 comments on commit 3527506

Please sign in to comment.