Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdif…
Commit: 6b376842d713f0cbc6fe9536ec77c70fbb92df04
Parent: 0000000000000000000000000000000000000000
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: 2011-12-13 15:44 +0000
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: 2011-12-13 15:44 +0000
annotated tag: 3.1.3 has been created
at 6b376842d713f0cbc6fe9536ec77c70fbb92df04 (tag)
tagging 6dc017bb81e97b4beaf9402207ba4f945990e35f (commit)
replaces 3.1.2
Version 3.1.3
Abhi Das (2):
Revert "mount.gfs2 - gfs2 mounts doubled up in mtab"
mount.gfs2 - gfs2 mounts doubled up in mtab
Abhijith Das (1):
mount.gfs2 - gfs2 mounts doubled up in mtab
Andrew Price (16):
mkfs: Handle gfs2 creation on regular files
gfs2-utils: Update .gitignore for i18n files
tunegfs2: Add some malloc error checking
gfs2_edit: Initialize metafds fully in savemetaopen
libgfs2: clean up some dead code in gfs2_writei
libgfs2: Remove dead code from gfs2_get_leaf
gfs_controld: Remove dead code from loop()
gfs2_edit: Fix segfault in find by resource group
libgfs2: Fix null pointer dereference in linked_leaf_search
gfs2_edit: Fix zeroing the memory for indirect
gfs_controld: Fix if-statement in shutdown_callback
libgfs2: Fix pointer arithmetic in gfs2_quota_change_*
libgfs2: Don't count sentinel dirent as an entry
mkfs.gfs2: Some minor cleanups
libgfs2: Improve rgblocks2bitblocks()
gfs2-utils: Add gfs2-cluster systemd unit
Bob Peterson (68):
fsck.gfs2: Make functions use sdp rather than sbp
fsck.gfs2: Change "if(" to "if ("
libgfs1: Add gfs1 variable to superblock structure
libgfs2: Make check_sb and read_sb operate on gfs1
libgfs2: move gfs1 structures to libgfs2
fsck.gfs2: Check for blocks wrongly inside resource groups
fsck.gfs2: Rename check_leaf to check_ealeaf_block
fsck.gfs2: fsck.gfs2: Delete vestigial buffer_head in check_leaf
fsck.gfs2: fsck.gfs2: Rename nlink functions to be intuitive
fsck.gfs2: fsck.gfs2: Sync di_nlink adding links for lost+found
fsck.gfs2: fsck.gfs2: Make dir entry count 32 bits
fsck.gfs2: get rid of triple negative logic
dirent_repair needs to mark the buffer as modified
fsck.gfs2: fsck.gfs2: Ask to reclaim unlinked meta per-rgrp only
fsck.gfs2: fsck.gfs2: Refactor add_dotdot function in lost+found
libgfs2: libgfs2: Use __FUNCTION__ rather than __FILE__
fsck.gfs2: fsck.gfs2: Don't stop invalidating blocks on invalid
fsck.gfs2: fsck.gfs2: Find and clear duplicate leaf blocks refs
fsck.gfs2: fsck.gfs2: Move check_num_ptrs from metawalk to pass1
fsck.gfs2: fsck.gfs2: Duplicate ref processing for leaf blocks
fsck.gfs2: fsck.gfs2: split check_leaf_blks to be more readable
fsck.gfs2: Shorten output
fsck.gfs2: Make output messages more sensible
fsck.gfs pass2: Refactor function set_dotdor_dir
fsck.gfs2 pass2: Delete extended attributes with inode
fsck.gfs2 pass2: Don't delete invalid inode metadata
fsck.gfs2 pass3: Refactor mark_and_return_parent
fsck.gfs2: misc cosmetic changes
fsck.gfs2: Don't use old_leaf if it was a duplicate
fsck.gfs2: Add find_remove_dup, free_block_if_notdup
fsck.gfs2: don't free prev rgrp list repairing rgrps
libgfs2: eliminate gfs1_readi in favor of gfs2_readi
libgfs2: Mark buffer modified adding a new GFS1 block
libgfs2: Use dinode buffer to map gfs1 dinode blocks
libgfs2: move block_map functions to fsck.gfs2
libgfs2: eliminate gfs1_rindex_read
libgfs2: combine ri_update and gfs1_ri_update
libgfs2: combine gfs_inode_read and gfs_inode_get
libgfs2: move gfs1 functions from edit to libgfs2
gfs2_edit savemeta: save_inode_data backward for gfs1
libgfs2: expand capabilities to operate on gfs1
fsck.gfs2: Combine block and char device inode types
fsck.gfs2: four-step duplicate elimination process
fsck.gfs2: Add ability to check gfs1 file systems
fsck.gfs2: Remove bad inodes from duplicate tree
fsck.gfs2: Handle duplicate reference to dinode blocks
fsck.gfs2: Bad extended attributes not deleted
libgfs2: Make rebuild functions not re-read ip
fsck.gfs2: Shorten debug output
fsck.gfs2: Increment link count reporting wrong dinode
fsck.gfs2: system dinodes take priority over user dinodes
fsck.gfs2: Recognize partially gfs2-converted dinodes
fsck.gfs2: Print step 2 duplicate debug msg first
fsck.gfs2: pass1c counts percentage backward
fsck.gfs2: Speed up rangecheck functions
libgfs2: Make in-core rgrps use rbtree
fsck.gfs2: Fix memory leaks
gfs2_edit: Fix memory leaks
Change man pages and gfs2_convert messages to include GFS
fsck.gfs2: Journals not properly checked
fsck.gfs2: Rearrange block types to group all inode types
fsck.gfs2: Fix initialization error return codes
fsck.gfs2: Don't use strerror for libgfs2 errors
fsck.gfs2: Fix memory leak in initialize.c
fsck.gfs2: Add return code checks and initializations
gfs2_edit: Fix segfault jumping within rindex
libgfs2: Fix off-by-one error in rgrp searching
gfs2-utils: gfs2_grow fails to grow a filesystem with less than 3 RGs
Carlos Maiolino (10):
libgfs2: Add new RGSIZE macros
mkfs: Change hardcoded numbers by new macro definitions
i18n: strings review
mkfs: Use rpmatch() to yes/no questions
mkfs: Remove unneeded open/close fd test from are_you_sure()
mkfs: remove duplicated code to ask yes/no question
mkfs: fix error handling
gfs2_grow: fix error handling, i18n strings
gfs2_jadd: Fix error handlers
fsck: Merge strings
David Teigland (2):
gfs_controld: track membership changes
gfs_controld: don't ignore dlmc_fs_register error
Steven Whitehouse (12):
tunegfs2: Fix usage and ensure we don't try to open a null device
tunegfs2: Fix label/locktable setting code
libgfs2: Move generic_interrupt() into utils
libgfs2: Move gfs2_getch into utils
libgfs2: Prepare to remove log_xxx() macros from library
libgfs2: Move some debug messages out into mkfs/fsck
libgfs2: Clean up sb read/check functions
libgfs2: Remove some more log_xxx calls
libgfs2: Clean up device geometry code
libgfs2: More unused bits (re)moved
libgfs2: Remove more unused macros/functions
gfs2_edit: Fix signal handling and window resize
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdif…
Commit: 6dc017bb81e97b4beaf9402207ba4f945990e35f
Parent: 72f66b2798c5f8edffba3bcb0722e2a85e0807f0
Author: Steven Whitehouse <swhiteho(a)redhat.com>
AuthorDate: Tue Dec 6 18:00:54 2011 +0000
Committer: Steven Whitehouse <swhiteho(a)redhat.com>
CommitterDate: Tue Dec 13 15:03:49 2011 +0000
gfs2_edit: Fix signal handling and window resize
This started out as a patch to remove the signal() call from this
bit of code, but when I started looking in more detail, I
spotted several other things which were wrong, so I fixed
those instead.
Firstly ncurses has its own SIGWINCH handler these days, so
we should not be overriding it, but instead, getting the info
about resize at getch() time.
Secondly, the function for erasing the screen was using the
supposed number of columns to index an array which was only 256
in length, so although unlikely to happen in real life, this
could cause an out of bounds access.
The simple solution seems to be to use ncurses own functions.
I noted some comments about them not working correctly, but
with the additional setting of the background attributes,
that seemed to work ok to me, unless I'm missing something.
I've played around resizing the window and the like and it
all seems to still be working correctly.
Signed-off-by: Steven Whitehouse <swhiteho(a)redhat.com>
---
gfs2/edit/gfs2hex.c | 1 -
gfs2/edit/hexedit.c | 54 ++++++++++----------------------------------------
gfs2/edit/hexedit.h | 1 -
3 files changed, 11 insertions(+), 45 deletions(-)
diff --git a/gfs2/edit/gfs2hex.c b/gfs2/edit/gfs2hex.c
index 5616122..41630f9 100644
--- a/gfs2/edit/gfs2hex.c
+++ b/gfs2/edit/gfs2hex.c
@@ -56,7 +56,6 @@ int start_row[DMODES], end_row[DMODES], lines_per_row[DMODES];
struct gfs_sb *sbd1;
int gfs2_struct_type;
unsigned int offset;
-int termcols = 80;
struct indirect_info masterdir;
struct gfs2_inum gfs1_quota_di;
int print_entry_ndx;
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 267e8ca..052be4c 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -42,6 +42,7 @@ struct gfs2_log_descriptor *lld;
int pgnum;
int details = 0;
long int gziplevel = 9;
+static int termcols;
int display(int identify_only);
@@ -742,50 +743,14 @@ static int gfs2_qc_assignval(struct gfs2_quota_change *qc,
return -1;
}
-/* ------------------------------------------------------------------------ */
-/* UpdateSize - screen size changed, so update it */
-/* ------------------------------------------------------------------------ */
-static void UpdateSize(int sig)
-{
- static char term_buffer[2048];
- int rc;
-
- termlines = 30;
- termtype = getenv("TERM");
- if (termtype == NULL)
- return;
- rc=tgetent(term_buffer,termtype);
- if (rc>=0) {
- termlines = tgetnum((char *)"li");
- if (termlines < 10)
- termlines = 30;
- termcols = tgetnum((char *)"co");
- if (termcols < 80)
- termcols = 80;
- }
- else
- perror("Error: tgetent failed.");
- termlines--; /* last line is number of lines -1 */
- display(FALSE);
- signal(SIGWINCH, UpdateSize);
-}
-
/* ------------------------------------------------------------------------- */
/* erase - clear the screen */
/* ------------------------------------------------------------------------- */
static void Erase(void)
{
- int i;
- char spaces[256];
-
- memset(spaces, ' ', sizeof(spaces));
- spaces[termcols] = '\0';
- for (i = 0; i < termlines; i++) {
- move(i, 0);
- printw(spaces);
- }
- /*clear(); doesn't set background correctly */
- /*erase();*/
+ bkgd(A_NORMAL|COLOR_PAIR(COLOR_NORMAL));
+ /* clear();*/ /* doesn't set background correctly */
+ erase();
/*bkgd(bg);*/
}
@@ -2708,10 +2673,9 @@ static void interactive_mode(void)
eol(0);
exit(-1);
}
-
+ getmaxyx(stdscr, termlines, termcols);
+ termlines--;
/* Do our initial screen stuff: */
- signal(SIGWINCH, UpdateSize); /* handle the terminal resize signal */
- UpdateSize(0); /* update screen size based on terminal settings */
clear(); /* don't use Erase */
start_color();
noecho();
@@ -2934,11 +2898,15 @@ static void interactive_mode(void)
/* --------------------------------------------------------- */
/* enter key - change a value */
/* --------------------------------------------------------- */
- case(KEY_ENTER):
+ case KEY_ENTER:
case('\n'):
case('\r'):
editing = !editing;
break;
+ case KEY_RESIZE:
+ getmaxyx(stdscr, termlines, termcols);
+ termlines--;
+ break;
default:
move(termlines - 1, 0);
printw("Keystroke not understood: 0x%03x",ch);
diff --git a/gfs2/edit/hexedit.h b/gfs2/edit/hexedit.h
index 02281cf..27950b0 100644
--- a/gfs2/edit/hexedit.h
+++ b/gfs2/edit/hexedit.h
@@ -38,7 +38,6 @@ extern uint64_t dev_offset;
extern uint64_t max_block;
extern struct gfs2_buffer_head *bh;
extern int termlines;
-extern int termcols;
extern int insert;
extern const char *termtype;
extern int line;
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdif…
Commit: 4761a8a1bd6435c24f13a10202a3f77f820abfab
Parent: 91f331d094994cd33abcdca84e7e2989f44170fe
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Tue Dec 13 13:58:49 2011 +0000
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Tue Dec 13 14:19:23 2011 +0000
gfs2-utils: Add gfs2-cluster systemd unit
Adds a systemd unit file to start gfs_controld at the correct point in
the boot sequence. I've tested this as much as I can on Fedora 16 but it
may require some more tweaking once the init scripts for cman, clvmd,
etc. have been migrated. The gfs2 init script has not been migrated as
systemd should now handle mounting of gfs2 file systems specially, after
remote-fs-pre.target.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/system/gfs2-cluster.service | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/gfs2/system/gfs2-cluster.service b/gfs2/system/gfs2-cluster.service
new file mode 100644
index 0000000..d6bc0ca
--- /dev/null
+++ b/gfs2/system/gfs2-cluster.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=GFS2 Control Daemon
+After=syslog.target network.target cman.service
+Before=remote-fs-pre.target
+Wants=remote-fs-pre.target
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/gfs_controld $OPTIONS
+
+[Install]
+WantedBy=multi-user.target
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commi…
Commit: 68fad86de38494cd0927174da0a62732e89be1ff
Parent: db314d3957b2c17b6e3bcc035f2738b771631bdd
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Fri Dec 9 10:01:18 2011 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Fri Dec 9 10:01:18 2011 +0100
fence_rackswitch: Add metadata output for fence_rackswitch agent
Adding this feature allow us to generate manual pages directly from XML,
so both GUI tools and manual pages can see same feature.
Makefile for fence_ipmilan is modified because it can reuse same snippets
Resolves: rhbz#714841 (partial)
---
fence/agents/rackswitch/Makefile.am | 8 +++
fence/agents/rackswitch/do_rack.c | 46 ++++++++++++++++++-
fence/agents/rackswitch/fence_rackswitch.8 | 70 ----------------------------
make/fencemanc.mk | 7 +++
4 files changed, 60 insertions(+), 71 deletions(-)
diff --git a/fence/agents/rackswitch/Makefile.am b/fence/agents/rackswitch/Makefile.am
index 29cbef8..b6369e4 100644
--- a/fence/agents/rackswitch/Makefile.am
+++ b/fence/agents/rackswitch/Makefile.am
@@ -9,3 +9,11 @@ noinst_HEADERS = do_rack.h
fence_rackswitch_SOURCES = do_rack.c
dist_man_MANS = $(TARGET).8
+
+fence_rackswitch.8: fence_rackswitch $(top_srcdir)/fence/agents/lib/fence2man.xsl
+ set -e && \
+ ./$^ -o metadata > .$@.tmp && \
+ xsltproc $(top_srcdir)/fence/agents/lib/fence2man.xsl .$@.tmp > $@
+
+clean-local:
+ rm -f *.8 .*.8.tmp
\ No newline at end of file
diff --git a/fence/agents/rackswitch/do_rack.c b/fence/agents/rackswitch/do_rack.c
index 854b475..67d24a2 100644
--- a/fence/agents/rackswitch/do_rack.c
+++ b/fence/agents/rackswitch/do_rack.c
@@ -158,6 +158,40 @@ static void print_usage(void)
+static void print_metadata(void)
+{
+ printf("<?xml version=\"1.0\" ?>\n"
+ "<resource-agent name=\"fence_rackswitch\" shortdesc=\"fence_rackswitch - I/O Fencing agent for RackSaver RackSwitch\" >\n"
+ "<longdesc>fence_rackswitch is an I/O Fencing agent which can be used with the RackSaver RackSwitch. It logs into the RackSwitch and boots a specified plug. Using the http interface to the RackSwitch should be avoided while a GFS cluster is running because the connection may interfere with the operation of this agent.</longdesc>\n"
+ "<vendor-url>http://www.bladenetwork.net</vendor-url>\n"
+ "<parameters>\n"
+ "<parameter name=\"ipaddr\" unique=\"1\" required=\"1\">\n"
+ "\t<getopt mixed=\"-a <ip>\" />\n"
+ "\t<content type=\"string\" />\n"
+ "\t<shortdesc lang=\"en\">IP Address or Hostname</shortdesc>\n"
+ "</parameter>\n"
+ "<parameter name=\"login\" unique=\"1\" required=\"1\">\n"
+ "\t<getopt mixed=\"-l <name>\" />\n"
+ "\t<content type=\"string\" />\n"
+ "\t<shortdesc lang=\"en\">Login Name</shortdesc>\n"
+ "</parameter>\n"
+ "<parameter name=\"passwd\" unique=\"1\" required=\"0\">\n"
+ "\t<getopt mixed=\"-p <password>\" />\n"
+ "\t<content type=\"string\" />\n"
+ "\t<shortdesc lang=\"en\">Login password or passphrase</shortdesc>\n"
+ "</parameter>\n"
+ "<parameter name=\"passwd_script\" unique=\"1\" required=\"0\">\n"
+ "\t<getopt mixed=\"-S <script>\" />\n"
+ "\t<content type=\"string\" />\n"
+ "\t<shortdesc lang=\"en\">Script to retrieve password</shortdesc>\n"
+ "</parameter>\n"
+ "</parameters>\n"
+ "<actions>\n"
+ "\t<action name=\"metadata\" />\n"
+ "</actions>\n"
+ "</resource-agent>\n");
+}
+
static void get_options(int argc, char **argv)
{
int c;
@@ -167,7 +201,7 @@ static void get_options(int argc, char **argv)
/*
* Command line input
*/
- while ((c = getopt(argc, argv, "ha:n:l:p:S:vqVd")) != -1)
+ while ((c = getopt(argc, argv, "ha:n:l:p:S:vqVdo:")) != -1)
{
switch(c)
{
@@ -220,6 +254,16 @@ static void get_options(int argc, char **argv)
fprintf(stderr, "Please use '-h' for usage.\n");
exit(DID_FAILURE);
break;
+
+ case 'o':
+ if (strncasecmp(optarg, "metadata", 254) == 0) {
+ print_metadata();
+ exit(DID_SUCCESS);
+ } else {
+ fprintf(stderr, "Only 'metadata' option is aviable for this fence agent\n");
+ exit(DID_FAILURE);
+ }
+ break;
default:
fprintf(stderr, "Bad programmer! You forgot to catch the %c flag\n", c);
diff --git a/fence/agents/rackswitch/fence_rackswitch.8 b/fence/agents/rackswitch/fence_rackswitch.8
deleted file mode 100644
index fc64a79..0000000
--- a/fence/agents/rackswitch/fence_rackswitch.8
+++ /dev/null
@@ -1,70 +0,0 @@
-.TH fence_rackswitch 8
-
-.SH NAME
-fence_rackswitch - I/O Fencing agent for RackSaver RackSwitch
-
-.SH SYNOPSIS
-.B
-fence_rackswitch
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_rackswitch is an I/O Fencing agent which can be used with the RackSaver
-RackSwitch. It logs into the RackSwitch and boots a specified plug.
-Using the http interface to the RackSwitch should be avoided while a GFS cluster is
-running because the connection may interfere with the operation of this agent.
-
-fence_rackswitch accepts options on the command line as well as from stdin.
-fenced sends the options through stdin when it execs the agent. fence_rackswitch
-can be run by itself with command line options which is useful for testing.
-
-Vendor URL: http://www.bladenetwork.net
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fP
-IP address of the switch.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-n\fP \fIplug\fP
-The plug number to power cycle.
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-l\fP \fIusername\fP
-Username for login.
-.TP
-\fB-q\fP
-Quiet operation. Only print out error messages.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_rackswitch.
-.TP
-\fIipaddr = < ip >\fR
-IP address of the switch.
-.TP
-\fIusername = < param >\fR
-Username for login.
-.TP
-\fIpassword = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-.TP
-\fIport = < param >\fR
-The port (outlet) number to act upon.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/make/fencemanc.mk b/make/fencemanc.mk
new file mode 100644
index 0000000..70ee773
--- /dev/null
+++ b/make/fencemanc.mk
@@ -0,0 +1,7 @@
+%.8: $(TARGET) $(top_srcdir)/fence/agents/lib/fence2man.xsl
+ set -e && \
+ ./$(TARGET) -o metadata > .$@.tmp && \
+ xsltproc $(top_srcdir)/fence/agents/lib/fence2man.xsl .$@.tmp > $@
+
+clean-man:
+ rm -f *.8 .*.8.tmp
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commi…
Commit: db314d3957b2c17b6e3bcc035f2738b771631bdd
Parent: 6f27315c0737a98395b7d905dc289ef3c344630b
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Fri Dec 9 09:30:12 2011 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Fri Dec 9 09:44:47 2011 +0100
fence_vmware_soap: Support for alias names as ports
Extending fence agent to support (-n / port) can use alias names of VM.
They can be obtained using 'list' action. This feature won't work correctly
if you have several VM with same name, in that case you should use either
full path or UUID.
Resolves: rhbz#715107
---
fence/agents/vmware_soap/fence_vmware_soap.py | 35 ++++++++++++++++--------
1 files changed, 23 insertions(+), 12 deletions(-)
diff --git a/fence/agents/vmware_soap/fence_vmware_soap.py b/fence/agents/vmware_soap/fence_vmware_soap.py
index 2718560..f9344ff 100644
--- a/fence/agents/vmware_soap/fence_vmware_soap.py
+++ b/fence/agents/vmware_soap/fence_vmware_soap.py
@@ -94,18 +94,28 @@ def get_power_status(conn, options):
return machines
else:
if options.has_key("-U") == False:
- ## Transform InventoryPath to UUID
- mo_SearchIndex = Property(options["ServiceContent"].searchIndex.value)
- mo_SearchIndex._type = "SearchIndex"
+ if options["-n"].startswith('/'):
+ ## Transform InventoryPath to UUID
+ mo_SearchIndex = Property(options["ServiceContent"].searchIndex.value)
+ mo_SearchIndex._type = "SearchIndex"
- vm = conn.service.FindByInventoryPath(mo_SearchIndex, options["-n"])
+ vm = conn.service.FindByInventoryPath(mo_SearchIndex, options["-n"])
- try:
- options["-U"] = mappingToUUID[vm.value]
- except KeyError, ex:
- fail(EC_STATUS)
- except AttributeError, ex:
- fail(EC_STATUS)
+ try:
+ options["-U"] = mappingToUUID[vm.value]
+ except KeyError, ex:
+ fail(EC_STATUS)
+ except AttributeError, ex:
+ fail(EC_STATUS)
+ else:
+ ## Name of virtual machine instead of path
+ ## warning: if you have same names of machines this won't work correctly
+ try:
+ (options["-U"], _) = machines[options["-n"]]
+ except KeyError, ex:
+ fail(EC_STATUS)
+ except AttributeError, ex:
+ fail(EC_STATUS)
try:
if uuid[options["-U"]] == "poweredOn":
@@ -149,8 +159,9 @@ which can be used with the virtual machines managed by VMWare products \
that have SOAP API v4.1+. \
\n.P\n\
Name of virtual machine (-n / port) has to be used in inventory path \
-format (e.g. /datacenter/vm/Discovered virtual machine/myMachine). Alternatively \
-you can use UUID (-U / uuid) to access virtual machine."
+format (e.g. /datacenter/vm/Discovered virtual machine/myMachine). \
+In the cases when name of yours VM is unique you can use it instead. \
+Alternatively you can always use UUID (-U / uuid) to access virtual machine."
docs["vendorurl"] = "http://www.vmware.com"
show_docs(options, docs)