Revision 74adc100

b/lib/cli.py
123 123
  "TAG_SRC_OPT",
124 124
  "TIMEOUT_OPT",
125 125
  "USEUNITS_OPT",
126
  "USE_REPL_NET_OPT",
126 127
  "VERBOSE_OPT",
127 128
  "VG_NAME_OPT",
128 129
  "YES_DOIT_OPT",
......
890 891
                                    help=("Create a new HMAC key for %s" %
891 892
                                          constants.CONFD))
892 893

  
894
USE_REPL_NET_OPT = cli_option("--use-replication-network",
895
                              dest="use_replication_network",
896
                              help="Whether to use the replication network"
897
                              " for talking to the nodes",
898
                              action="store_true", default=False)
899

  
893 900

  
894 901
def _ParseArgs(argv, commands, aliases):
895 902
  """Parser for the command line arguments.
b/man/gnt-cluster.sgml
138 138

  
139 139
      <cmdsynopsis>
140 140
        <command>copyfile</command>
141
        <arg>--use-replication-network</arg>
141 142
        <arg>-n <replaceable>node</replaceable></arg>
142 143
        <arg choice="req"><replaceable>file</replaceable></arg>
143 144
      </cmdsynopsis>
......
150 151
        <option>-n</option> is not given at all, the file will be
151 152
        copied to all nodes.
152 153

  
154
        Passing the <option>--use-replication-network</option> option
155
        will cause the copy to be done over the replication network
156
        (only matters if the primary/secondary IPs are different).
157

  
153 158
        Example:
154 159
        <screen>
155 160
          # gnt-cluster -n node1.example.com -n node2.example.com copyfile /tmp/test
b/scripts/gnt-cluster
300 300

  
301 301
  cl = GetClient()
302 302

  
303
  myname = utils.GetHostInfo().name
304

  
305 303
  cluster_name = cl.QueryConfigValues(["cluster_name"])[0]
306 304

  
307
  results = GetOnlineNodes(nodes=opts.nodes, cl=cl)
308
  results = [name for name in results if name != myname]
305
  results = GetOnlineNodes(nodes=opts.nodes, cl=cl, filter_master=True,
306
                           secondary_ips=opts.use_replication_network)
309 307

  
310 308
  srun = ssh.SshRunner(cluster_name=cluster_name)
311 309
  for node in results:
......
749 747
    "", "Shows the cluster master"),
750 748
  'copyfile': (
751 749
    ClusterCopyFile, [ArgFile(min=1, max=1)],
752
    [NODE_LIST_OPT],
750
    [NODE_LIST_OPT, USE_REPL_NET_OPT],
753 751
    "[-n node...] <filename>", "Copies a file to all (or only some) nodes"),
754 752
  'command': (
755 753
    RunClusterCommand, [ArgCommand(min=1)],

Also available in: Unified diff