Permalink
Browse files

Added ability to specify clone options when creating a clone with pcs…

… resource create --clone
  • Loading branch information...
1 parent 8250517 commit 914414e71db7b1691a0dc2ef8e7e976a76e46e96 @feist feist committed Sep 20, 2012
Showing with 17 additions and 6 deletions.
  1. +8 −2 pcs/pcs.py
  2. +6 −1 pcs/resource.py
  3. +3 −3 pcs/usage.py
View
@@ -32,14 +32,20 @@ def main(argv):
modified_argv.append(arg)
prev_arg = arg
- pcs_options, argv = getopt.gnu_getopt(modified_argv, "hf:p:u:", ["local","start","all","clone","master"])
+ pcs_options, argv = getopt.gnu_getopt(modified_argv, "hf:p:u:", ["local","start","all","clone","cloneopt=","master"])
except getopt.GetoptError, err:
print err
usage.main()
sys.exit(1)
argv = real_argv
for o, a in pcs_options:
- utils.pcs_options[o] = a
+ if not o in utils.pcs_options:
+ utils.pcs_options[o] = a
+ else:
+ if type(utils.pcs_options[o]) is list:
+ utils.pcs_options[o].append(a)
+ else:
+ utils.pcs_options[o] = [utils.pcs_options[o], a]
if o == "-h":
if len(argv) == 0:
usage.main()
View
@@ -222,7 +222,12 @@ def resource_create(ra_id, ra_type, ra_values, op_values):
sys.exit(1)
if "--clone" in utils.pcs_options:
- resource_clone_create([ra_id])
+ clone_opts = []
+ if "--cloneopt" in utils.pcs_options:
+ clone_opts = utils.pcs_options["--cloneopt"]
+ if type(clone_opts) != list:
+ clone_opts = [clone_opts]
+ resource_clone_create([ra_id] + clone_opts)
elif "--master" in utils.pcs_options:
resource_master_create([ra_id+"-master",ra_id])
View
@@ -41,9 +41,9 @@ def resource():
Show options for the specified resource
create <resource id> <class:provider:type|type> [resource options]
- Create specified resource. If --clone is specified a clone resource
- is created, if --master is specified a master/slave resource is
- created.
+ Create specified resource. If --clone is specified a clone resource is
+ created (with options specified by --cloneopt <clone_option>=<value>),
+ if --master is specified a master/slave resource is created.
standards
List available resource agent standards

0 comments on commit 914414e

Please sign in to comment.