Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cc-cli
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
cc-cli
Commits
05fb5e1a
Commit
05fb5e1a
authored
14 years ago
by
Seblu
Browse files
Options
Downloads
Patches
Plain Diff
addacount now use OptionCommand
parent
5549e95c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cccli/command/account.py
+11
-10
11 additions, 10 deletions
cccli/command/account.py
with
11 additions
and
10 deletions
cccli/command/account.py
+
11
−
10
View file @
05fb5e1a
...
...
@@ -8,21 +8,22 @@ CloudControl accounts related commands
from
cccli.exception
import
*
from
sjrpc.core.exceptions
import
*
from
cccli.printer
import
Printer
,
color
from
cccli.command.command
import
Command
,
TqlCommand
from
cccli.command.command
import
Command
,
OptionCommand
,
TqlCommand
class
Command_addaccount
(
Command
):
class
Command_addaccount
(
Option
Command
):
'''
Create an account
'''
def
__init__
(
self
,
cli
,
argv0
):
OptionCommand
.
__init__
(
self
,
cli
,
argv0
)
self
.
set_usage
(
"
%prog [options] <account name> <role>
"
)
def
__call__
(
self
,
argv
):
if
len
(
argv
)
!=
3
:
# parse args
self
.
parse_args
(
argv
)
if
len
(
self
.
args
)
!=
2
:
raise
cmdBadArgument
()
try
:
self
.
cli
.
rpc
.
call
(
"
addaccount
"
,
argv
[
1
],
argv
[
2
])
except
RpcError
as
e
:
raise
cmdError
(
"
RPCError: %s
"
%
str
(
e
))
def
usage
(
self
):
return
"
Usage: addaccount <account name> <role>
"
# execute command
self
.
rpccall
(
"
addaccount
"
,
self
.
args
[
0
],
self
.
args
[
1
])
class
Command_delaccount
(
TqlCommand
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment