diff options
36 files changed, 892 insertions, 147 deletions
diff --git a/build/gluster-management-console.target b/build/gluster-management-console.target index b03021d9..b74d8040 100644 --- a/build/gluster-management-console.target +++ b/build/gluster-management-console.target @@ -7,6 +7,7 @@ <location path="gmc-target/com.gluster.storage.management.console.target/richclientgui.rcptoolbox" type="Directory"/> <location path="gmc-target/com.gluster.storage.management.console.target/birt.charts.helios" type="Directory"/> <location path="gmc-target/com.gluster.storage.management.console.target/delta.pack.helios" type="Directory"/> +<location path="gmc-target/com.gluster.storage.management.console.target/org.eclipse.tm.terminal" type="Directory"/> </locations> <targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> </target> diff --git a/src/com.gluster.storage.management.console.feature.webstart/rootfiles/splash.png b/src/com.gluster.storage.management.console.feature.webstart/rootfiles/splash.png Binary files differindex 293329da..25e2c99b 100644 --- a/src/com.gluster.storage.management.console.feature.webstart/rootfiles/splash.png +++ b/src/com.gluster.storage.management.console.feature.webstart/rootfiles/splash.png diff --git a/src/com.gluster.storage.management.console.feature/feature.xml b/src/com.gluster.storage.management.console.feature/feature.xml index e5899660..fdafcd35 100644 --- a/src/com.gluster.storage.management.console.feature/feature.xml +++ b/src/com.gluster.storage.management.console.feature/feature.xml @@ -897,4 +897,39 @@ version="0.0.0" unpack="false"/> + <plugin + id="org.eclipse.tm.terminal" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.tm.terminal.ssh" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.tm.terminal.view" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="com.jcraft.jsch" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.jsch.core" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + </feature> diff --git a/src/com.gluster.storage.management.console/META-INF/MANIFEST.MF b/src/com.gluster.storage.management.console/META-INF/MANIFEST.MF index 30589606..4194aae3 100644 --- a/src/com.gluster.storage.management.console/META-INF/MANIFEST.MF +++ b/src/com.gluster.storage.management.console/META-INF/MANIFEST.MF @@ -23,7 +23,10 @@ Require-Bundle: org.eclipse.ui;bundle-version="3.6.1", com.richclientgui.rcptoolbox;bundle-version="1.0.5", org.eclipse.core.resources, org.apache.commons.lang;bundle-version="2.3.0", - com.gluster.storage.management.console.help;bundle-version="1.0.0" + com.gluster.storage.management.console.help;bundle-version="1.0.0", + org.eclipse.tm.terminal;bundle-version="3.1.0", + org.eclipse.tm.terminal.ssh;bundle-version="2.1.0", + org.eclipse.tm.terminal.view;bundle-version="2.2.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-ActivationPolicy: lazy Bundle-ClassPath: . diff --git a/src/com.gluster.storage.management.console/icons/tango/16x16/utilities-terminal.png b/src/com.gluster.storage.management.console/icons/tango/16x16/utilities-terminal.png Binary files differnew file mode 100644 index 00000000..c5b797a7 --- /dev/null +++ b/src/com.gluster.storage.management.console/icons/tango/16x16/utilities-terminal.png diff --git a/src/com.gluster.storage.management.console/icons/tango/22x22/replace-brick.png b/src/com.gluster.storage.management.console/icons/tango/22x22/migrate-brick.png Binary files differindex 48a66c8c..48a66c8c 100644 --- a/src/com.gluster.storage.management.console/icons/tango/22x22/replace-brick.png +++ b/src/com.gluster.storage.management.console/icons/tango/22x22/migrate-brick.png diff --git a/src/com.gluster.storage.management.console/icons/tango/22x22/utilities-terminal.png b/src/com.gluster.storage.management.console/icons/tango/22x22/utilities-terminal.png Binary files differnew file mode 100644 index 00000000..ceb0fb99 --- /dev/null +++ b/src/com.gluster.storage.management.console/icons/tango/22x22/utilities-terminal.png diff --git a/src/com.gluster.storage.management.console/icons/tango/32x32/utilities-terminal.png b/src/com.gluster.storage.management.console/icons/tango/32x32/utilities-terminal.png Binary files differnew file mode 100644 index 00000000..f86c7840 --- /dev/null +++ b/src/com.gluster.storage.management.console/icons/tango/32x32/utilities-terminal.png diff --git a/src/com.gluster.storage.management.console/icons/tango/scalable/utilities-terminal.svg b/src/com.gluster.storage.management.console/icons/tango/scalable/utilities-terminal.svg new file mode 100644 index 00000000..995fb90b --- /dev/null +++ b/src/com.gluster.storage.management.console/icons/tango/scalable/utilities-terminal.svg @@ -0,0 +1,500 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="48px" + height="48px" + id="svg1306" + sodipodi:version="0.32" + inkscape:version="0.46" + sodipodi:docbase="/home/jimmac/src/cvs/tango-icon-theme/scalable/apps" + sodipodi:docname="utilities-terminal.svg" + inkscape:export-filename="/home/andreas/projekt/bild/tango/terminal4.png" + inkscape:export-xdpi="240.00000" + inkscape:export-ydpi="240.00000" + inkscape:output_extension="org.inkscape.output.svg.inkscape"> + <defs + id="defs1308"> + <inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="0 : 24 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_z="48 : 24 : 1" + inkscape:persp3d-origin="24 : 16 : 1" + id="perspective79" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient5060" + id="radialGradient5031" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(-2.774389,0,0,1.969706,112.7623,-872.8854)" + cx="605.71429" + cy="486.64789" + fx="605.71429" + fy="486.64789" + r="117.14286" /> + <linearGradient + inkscape:collect="always" + id="linearGradient5060"> + <stop + style="stop-color:black;stop-opacity:1;" + offset="0" + id="stop5062" /> + <stop + style="stop-color:black;stop-opacity:0;" + offset="1" + id="stop5064" /> + </linearGradient> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient5060" + id="radialGradient5029" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(2.774389,0,0,1.969706,-1891.633,-872.8854)" + cx="605.71429" + cy="486.64789" + fx="605.71429" + fy="486.64789" + r="117.14286" /> + <linearGradient + id="linearGradient5048"> + <stop + style="stop-color:black;stop-opacity:0;" + offset="0" + id="stop5050" /> + <stop + id="stop5056" + offset="0.5" + style="stop-color:black;stop-opacity:1;" /> + <stop + style="stop-color:black;stop-opacity:0;" + offset="1" + id="stop5052" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient5048" + id="linearGradient5027" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(2.774389,0,0,1.969706,-1892.179,-872.8854)" + x1="302.85715" + y1="366.64789" + x2="302.85715" + y2="609.50507" /> + <linearGradient + inkscape:collect="always" + id="linearGradient6447"> + <stop + style="stop-color:#777973;stop-opacity:1;" + offset="0" + id="stop6449" /> + <stop + style="stop-color:#777973;stop-opacity:0;" + offset="1" + id="stop6451" /> + </linearGradient> + <linearGradient + id="linearGradient4254"> + <stop + style="stop-color:#616161;stop-opacity:1.0000000;" + offset="0.0000000" + id="stop4256" /> + <stop + style="stop-color:#a0a0a0;stop-opacity:1.0000000;" + offset="1.0000000" + id="stop4258" /> + </linearGradient> + <linearGradient + id="linearGradient5176"> + <stop + id="stop5178" + offset="0.0000000" + style="stop-color:#a2a59c;stop-opacity:1.0000000;" /> + <stop + id="stop5180" + offset="1.0000000" + style="stop-color:#535750;stop-opacity:1.0000000;" /> + </linearGradient> + <linearGradient + id="linearGradient2667"> + <stop + id="stop2669" + offset="0.0000000" + style="stop-color:#ffffff;stop-opacity:1.0000000;" /> + <stop + id="stop2671" + offset="1.0000000" + style="stop-color:#fcfcff;stop-opacity:0.0000000;" /> + </linearGradient> + <linearGradient + gradientUnits="userSpaceOnUse" + y2="26.729263" + x2="17.199417" + y1="1.6537577" + x1="11.492236" + gradientTransform="matrix(1.236157,0.000000,0.000000,0.896051,-1.081820,2.830699)" + id="linearGradient2673" + xlink:href="#linearGradient2667" + inkscape:collect="always" /> + <linearGradient + inkscape:collect="always" + id="linearGradient2238"> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="0" + id="stop2240" /> + <stop + style="stop-color:#ffffff;stop-opacity:0;" + offset="1" + id="stop2242" /> + </linearGradient> + <linearGradient + id="linearGradient2224"> + <stop + style="stop-color:#32342f;stop-opacity:0.54639173;" + offset="0.0000000" + id="stop2226" /> + <stop + style="stop-color:#32342f;stop-opacity:0;" + offset="1" + id="stop2228" /> + </linearGradient> + <linearGradient + id="linearGradient2214"> + <stop + style="stop-color:#a9aaa7;stop-opacity:1.0000000;" + offset="0.0000000" + id="stop2216" /> + <stop + style="stop-color:#676964;stop-opacity:1.0000000;" + offset="1.0000000" + id="stop2218" /> + </linearGradient> + <linearGradient + id="linearGradient2206"> + <stop + style="stop-color:#777973;stop-opacity:1.0000000;" + offset="0.0000000" + id="stop2208" /> + <stop + style="stop-color:#cbccca;stop-opacity:1.0000000;" + offset="1.0000000" + id="stop2210" /> + </linearGradient> + <linearGradient + id="linearGradient2198"> + <stop + style="stop-color:#748f48;stop-opacity:1.0000000;" + offset="0.0000000" + id="stop2200" /> + <stop + style="stop-color:#1f2816;stop-opacity:1.0000000;" + offset="1.0000000" + id="stop2202" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2198" + id="linearGradient2204" + x1="23.118565" + y1="9.5830288" + x2="22.440805" + y2="34.225887" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.950085,0.000000,0.000000,0.965659,1.243978,0.255342)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2206" + id="linearGradient2212" + x1="29.870447" + y1="32.285740" + x2="24.841814" + y2="14.157946" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.957412,0.000000,0.000000,0.952331,1.022766,0.133307)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient5176" + id="linearGradient2220" + x1="8.6529236" + y1="9.5865316" + x2="21.305075" + y2="32.497993" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.957412,0.000000,0.000000,0.952331,1.022766,0.133307)" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient2224" + id="radialGradient2230" + cx="24.041630" + cy="42.242130" + fx="24.041630" + fy="42.242130" + r="17.576654" + gradientTransform="matrix(1.000000,0.000000,0.000000,0.304598,-1.841788e-16,29.37527)" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2238" + id="linearGradient2244" + x1="20.338758" + y1="19.636894" + x2="48.845253" + y2="49.730762" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.953506,0.000000,0.000000,0.947873,1.141528,1.205591)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4254" + id="linearGradient4260" + x1="11.048059" + y1="9.1463490" + x2="26.178129" + y2="30.343304" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.997583,0.000000,0.000000,0.989941,0.104141,7.028871e-2)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2214" + id="linearGradient5719" + x1="40.253334" + y1="42.318577" + x2="36.451904" + y2="37.999615" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.000000,0.000000,0.000000,0.744756,0.000000,9.569132)" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient6447" + id="radialGradient6453" + cx="37.495606" + cy="39.510023" + fx="37.495606" + fy="39.510023" + r="2.5100370" + gradientTransform="matrix(1.000000,0.000000,0.000000,0.737790,0.000000,9.844321)" + gradientUnits="userSpaceOnUse" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="0.19607843" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="1" + inkscape:cx="-138.1893" + inkscape:cy="12.124648" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:grid-bbox="true" + inkscape:document-units="px" + inkscape:window-width="926" + inkscape:window-height="818" + inkscape:window-x="0" + inkscape:window-y="30" + showguides="true" + inkscape:guide-bbox="true" + inkscape:showpageshadow="false" /> + <metadata + id="metadata1311"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title>Terminal</dc:title> + <dc:date>2005-10-15</dc:date> + <dc:creator> + <cc:Agent> + <dc:title>Andreas Nilsson</dc:title> + </cc:Agent> + </dc:creator> + <dc:subject> + <rdf:Bag> + <rdf:li>terminal</rdf:li> + <rdf:li>emulator</rdf:li> + <rdf:li>term</rdf:li> + <rdf:li>command line</rdf:li> + </rdf:Bag> + </dc:subject> + <cc:license + rdf:resource="http://creativecommons.org/licenses/publicdomain/" /> + <dc:contributor> + <cc:Agent> + <dc:title>Jakub Steiner</dc:title> + </cc:Agent> + </dc:contributor> + </cc:Work> + <cc:License + rdf:about="http://creativecommons.org/licenses/publicdomain/"> + <cc:permits + rdf:resource="http://creativecommons.org/ns#Reproduction" /> + <cc:permits + rdf:resource="http://creativecommons.org/ns#Distribution" /> + <cc:permits + rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /> + </cc:License> + </rdf:RDF> + </metadata> + <g + id="layer1" + inkscape:label="Layer 1" + inkscape:groupmode="layer"> + <g + id="g5022" + transform="matrix(2.454499e-2,0,0,2.086758e-2,46.14369,39.34109)"> + <rect + y="-150.69685" + x="-1559.2523" + height="478.35718" + width="1339.6335" + id="rect4173" + style="opacity:0.40206185;color:black;fill:url(#linearGradient5027);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" /> + <path + sodipodi:nodetypes="cccc" + id="path5058" + d="M -219.61876,-150.68038 C -219.61876,-150.68038 -219.61876,327.65041 -219.61876,327.65041 C -76.744594,328.55086 125.78146,220.48075 125.78138,88.454235 C 125.78138,-43.572302 -33.655436,-150.68036 -219.61876,-150.68038 z " + style="opacity:0.40206185;color:black;fill:url(#radialGradient5029);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" /> + <path + style="opacity:0.40206185;color:black;fill:url(#radialGradient5031);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" + d="M -1559.2523,-150.68038 C -1559.2523,-150.68038 -1559.2523,327.65041 -1559.2523,327.65041 C -1702.1265,328.55086 -1904.6525,220.48075 -1904.6525,88.454235 C -1904.6525,-43.572302 -1745.2157,-150.68036 -1559.2523,-150.68038 z " + id="path5018" + sodipodi:nodetypes="cccc" /> + </g> + <rect + style="opacity:1.0000000;fill:url(#linearGradient2212);fill-opacity:1.0000000;fill-rule:evenodd;stroke:url(#linearGradient2220);stroke-width:0.99999946;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000" + id="rect1316" + width="44.996037" + height="38.998734" + x="1.5026338" + y="3.5015533" + rx="4.8517075" + ry="4.8517079" /> + <rect + style="opacity:1.0000000;fill:url(#linearGradient2204);fill-opacity:1.0000000;fill-rule:evenodd;stroke:url(#linearGradient4260);stroke-width:0.99495775;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000" + id="rect1314" + width="37.088005" + height="29.022322" + x="5.4962788" + y="7.4827089" + rx="1.6452150" + ry="1.6452144" /> + <g + id="g2286" + style="opacity:0.25568182"> + <path + id="path1345" + d="M 8.0152033,11.500361 L 39.994145,11.500361" + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#181f10;stroke-width:1.00072134;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#181f10;stroke-width:1.00072134;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 8.0152033,13.500361 L 39.994145,13.500361" + id="path2264" /> + <path + id="path2266" + d="M 8.0152033,15.500361 L 39.994145,15.500361" + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#181f10;stroke-width:1.00072134;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#181f10;stroke-width:1.00072134;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 8.0152033,17.500361 L 39.994145,17.500361" + id="path2268" /> + <path + id="path2270" + d="M 8.0152033,19.500361 L 39.994145,19.500361" + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#181f10;stroke-width:1.00072134;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#181f10;stroke-width:1.00072134;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 8.0152033,21.500361 L 39.994145,21.500361" + id="path2272" /> + <path + id="path2274" + d="M 8.0152033,23.500361 L 39.994145,23.500361" + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#181f10;stroke-width:1.00072134;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#181f10;stroke-width:1.00072134;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 8.0152033,25.500361 L 39.994145,25.500361" + id="path2276" /> + <path + id="path2278" + d="M 8.0152033,27.500361 L 39.994145,27.500361" + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#181f10;stroke-width:1.00072134;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#181f10;stroke-width:1.00072134;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 8.0152033,29.500361 L 39.994145,29.500361" + id="path2280" /> + <path + id="path2282" + d="M 8.0152033,31.500361 L 39.994145,31.500361" + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#181f10;stroke-width:1.00072134;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#181f10;stroke-width:1.00072134;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 8.0152033,33.500361 L 39.994145,33.500361" + id="path2284" /> + </g> + <rect + style="opacity:0.76373626;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient2244);stroke-width:0.99999946;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect2232" + width="42.945141" + height="37.000587" + x="2.5542557" + y="4.5007114" + rx="3.7910469" + ry="3.7910469" /> + <path + style="font-size:18.585011px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125.00000%;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1.0000000;stroke:#6ed66e;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.27868852;font-family:Bitstream Vera Sans Mono" + d="M 11.625000,20.679392 L 11.625000,17.625000 L 20.609828,21.685794 L 20.609828,23.541713 L 11.625000,27.629147 L 11.625000,24.583829 L 18.589396,22.729971 L 11.625000,20.679392 z M 30.517635,30.705752 L 30.517635,32.679948 L 19.614229,32.679948 L 19.614229,30.705752 L 30.517635,30.705752" + id="text1340" + sodipodi:nodetypes="ccccccccccccc" /> + <path + sodipodi:nodetypes="ccccccc" + style="opacity:0.53142856;fill:url(#linearGradient2673);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.25pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 7.625388,8 C 7.102102,8 6.05153,8.190188 6.05153,9.0259761 L 6.16958,25.542519 C 23.841567,24.579133 20.294433,17.286426 42,13.633318 L 41.937264,9.2913791 C 41.859002,8.1662868 41.397947,8.0594548 40.327115,8.066071 L 7.625388,8 z " + id="path2443" /> + <rect + style="opacity:0.71428573;fill:none;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.9999992;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000" + id="rect1340" + width="34.026031" + height="26.057468" + x="6.9894562" + y="8.9805145" + rx="0.11773217" + ry="0.11773217" /> + <rect + style="opacity:1;fill:url(#radialGradient6453);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient5719);stroke-width:1.00000119;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect5025" + width="4.0200734" + height="2.9590063" + x="35.485569" + y="37.514935" + rx="0.35819405" + ry="0.56022596" /> + <rect + style="opacity:1;fill:#93d94c;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect6458" + width="2" + height="2" + x="32" + y="38" + rx="0.56022543" + ry="0.56022543" /> + <path + sodipodi:type="arc" + style="opacity:1;color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" + id="path2300" + sodipodi:cx="28.3125" + sodipodi:cy="38.75" + sodipodi:rx="0.5625" + sodipodi:ry="0.5625" + d="M 28.875 38.75 A 0.5625 0.5625 0 1 1 27.75,38.75 A 0.5625 0.5625 0 1 1 28.875 38.75 z" + transform="translate(4.375000,-6.250000e-2)" /> + </g> +</svg> diff --git a/src/com.gluster.storage.management.console/plugin.xml b/src/com.gluster.storage.management.console/plugin.xml index 29927d3b..675b7e52 100644 --- a/src/com.gluster.storage.management.console/plugin.xml +++ b/src/com.gluster.storage.management.console/plugin.xml @@ -175,6 +175,15 @@ name="Tasks" restorable="true"> </view> + <view + allowMultiple="false" + category="com.gluster.storage.management.console.category" + class="org.eclipse.tm.internal.terminal.view.TerminalView" + icon="icons/tango/16x16/utilities-terminal.png" + id="com.gluster.storage.management.console.views.TerminalView" + name="Terminal" + restorable="true"> + </view> </extension> <extension point="org.eclipse.ui.commands"> @@ -290,6 +299,12 @@ id="com.gluster.storage.management.console.commands.Refresh" name="Refresh Data"> </command> + <command + categoryId="com.gluster.storage.management.console.category" + description="Terminal" + id="com.gluster.storage.management.console.commands.Terminal" + name="Terminal"> + </command> </extension> <extension point="org.eclipse.ui.bindings"> @@ -375,6 +390,11 @@ schemeId="com.gluster.storage.management.console.KeyConfig" sequence="F5"> </key> + <key + commandId="com.gluster.storage.management.console.commands.Terminal" + schemeId="com.gluster.storage.management.console.KeyConfig" + sequence="CTRL+T"> + </key> </extension> <extension id="product" @@ -1100,6 +1120,21 @@ </action> <action allowLabelUpdate="false" + class="com.gluster.storage.management.console.actions.TerminalAction" + definitionId="com.gluster.storage.management.console.commands.Terminal" + icon="icons/tango/32x32/utilities-terminal.png" + id="com.gluster.storage.management.console.actions.TerminalAction" + label="&Terminal" + menubarPath="com.gluster.storage.management.console.menu.edit/edit" + pulldown="false" + retarget="false" + state="false" + style="push" + toolbarPath="Normal" + tooltip="Terminal"> + </action> + <action + allowLabelUpdate="false" class="com.gluster.storage.management.console.actions.ChangePasswordAction" definitionId="com.gluster.storage.management.console.commands.ChangePassword" id="com.gluster.storage.management.console.actions.ChangePasswordAction" @@ -1382,6 +1417,18 @@ standalone="false" visible="false"> </view> + <view + closeable="true" + id="com.gluster.storage.management.console.views.TerminalView" + minimized="false" + moveable="false" + ratio="0.60f" + relationship="bottom" + relative="com.gluster.storage.management.console.views.ClusterSummaryView" + showTitle="true" + standalone="false" + visible="false"> + </view> </perspectiveExtension> </extension> <extension diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/IActionConstants.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/ActionConstants.java index 862d4144..a1b70ad0 100644 --- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/IActionConstants.java +++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/ActionConstants.java @@ -18,7 +18,7 @@ *******************************************************************************/ package com.gluster.storage.management.console.actions; -public interface IActionConstants { +public class ActionConstants { public static final String ACTION_SET_CLUSTER = "com.gluster.storage.management.console.actionsets.gluster"; public static final String ACTION_SET_VOLUMES = "com.gluster.storage.management.console.actionsets.volumes"; public static final String ACTION_SET_VOLUME = "com.gluster.storage.management.console.actionsets.volume"; diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/TerminalAction.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/TerminalAction.java new file mode 100644 index 00000000..992cc11b --- /dev/null +++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/TerminalAction.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright (c) 2011 Gluster, Inc. <http://www.gluster.com> + * This file is part of Gluster Management Console. + * + * Gluster Management Console is free software; you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Gluster Management Console is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License + * for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see + * <http://www.gnu.org/licenses/>. + *******************************************************************************/ +package com.gluster.storage.management.console.actions; + +import org.eclipse.jface.action.IAction; + +import com.gluster.storage.management.console.utils.GUIHelper; + +/** + * + */ +public class TerminalAction extends AbstractActionDelegate { + + /* (non-Javadoc) + * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose() + */ + @Override + public void dispose() { + } + + /* (non-Javadoc) + * @see com.gluster.storage.management.console.actions.AbstractActionDelegate#performAction(org.eclipse.jface.action.IAction) + */ + @Override + protected void performAction(IAction action) { + GUIHelper.getInstance().showTerminalView(); + } +} diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/toolbar/GlusterToolbarManager.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/toolbar/GlusterToolbarManager.java index f8bcc446..ebd1db07 100644 --- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/toolbar/GlusterToolbarManager.java +++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/toolbar/GlusterToolbarManager.java @@ -24,7 +24,7 @@ import java.util.Map; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchWindow; -import com.gluster.storage.management.console.actions.IActionConstants; +import com.gluster.storage.management.console.actions.ActionConstants; import com.gluster.storage.management.core.model.Cluster; import com.gluster.storage.management.core.model.Entity; import com.gluster.storage.management.core.model.EntityGroup; @@ -55,14 +55,14 @@ public class GlusterToolbarManager implements ToolbarManager { private Map<ENTITY_TYPE, String> createActionSetMap() { Map<ENTITY_TYPE, String> actionSetMap = new HashMap<GlusterToolbarManager.ENTITY_TYPE, String>(); - actionSetMap.put(ENTITY_TYPE.CLUSTER, IActionConstants.ACTION_SET_CLUSTER); - actionSetMap.put(ENTITY_TYPE.VOLUMES, IActionConstants.ACTION_SET_VOLUMES); - actionSetMap.put(ENTITY_TYPE.VOLUME, IActionConstants.ACTION_SET_VOLUME); - actionSetMap.put(ENTITY_TYPE.GLUSTER_SERVERS, IActionConstants.ACTION_SET_GLUSTER_SERVERS); - actionSetMap.put(ENTITY_TYPE.GLUSTER_SERVER, IActionConstants.ACTION_SET_GLUSTER_SERVER); - actionSetMap.put(ENTITY_TYPE.DISCOVERED_SERVERS, IActionConstants.ACTION_SET_DISCOVERED_SERVERS); - actionSetMap.put(ENTITY_TYPE.DISCOVERED_SERVER, IActionConstants.ACTION_SET_DISCOVERED_SERVER); - actionSetMap.put(ENTITY_TYPE.TASK, IActionConstants.ACTION_SET_TASK); + actionSetMap.put(ENTITY_TYPE.CLUSTER, ActionConstants.ACTION_SET_CLUSTER); + actionSetMap.put(ENTITY_TYPE.VOLUMES, ActionConstants.ACTION_SET_VOLUMES); + actionSetMap.put(ENTITY_TYPE.VOLUME, ActionConstants.ACTION_SET_VOLUME); + actionSetMap.put(ENTITY_TYPE.GLUSTER_SERVERS, ActionConstants.ACTION_SET_GLUSTER_SERVERS); + actionSetMap.put(ENTITY_TYPE.GLUSTER_SERVER, ActionConstants.ACTION_SET_GLUSTER_SERVER); + actionSetMap.put(ENTITY_TYPE.DISCOVERED_SERVERS, ActionConstants.ACTION_SET_DISCOVERED_SERVERS); + actionSetMap.put(ENTITY_TYPE.DISCOVERED_SERVER, ActionConstants.ACTION_SET_DISCOVERED_SERVER); + actionSetMap.put(ENTITY_TYPE.TASK, ActionConstants.ACTION_SET_TASK); return actionSetMap; } diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/utils/GUIHelper.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/utils/GUIHelper.java index caeca0fa..841d5a9d 100644 --- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/utils/GUIHelper.java +++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/utils/GUIHelper.java @@ -84,6 +84,7 @@ import com.gluster.storage.management.console.GlusterDataModelManager; import com.gluster.storage.management.console.IImageKeys; import com.gluster.storage.management.console.views.NavigationView; import com.gluster.storage.management.console.views.TasksView; +import com.gluster.storage.management.console.views.TerminalView; import com.gluster.storage.management.core.exceptions.GlusterRuntimeException; import com.gluster.storage.management.core.model.Disk; import com.gluster.storage.management.core.utils.JavaUtil; @@ -91,6 +92,7 @@ import com.gluster.storage.management.core.utils.JavaUtil; public class GUIHelper { private static final GUIHelper instance = new GUIHelper(); private static final ImageUtil imageUtil = new ImageUtil(); + private static final GlusterLogger logger = GlusterLogger.getInstance(); private GUIHelper() { @@ -447,27 +449,30 @@ public class GUIHelper { }); } - public void showProgressView() { + public void showView(String viewId) { try { - PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() - .showView(IProgressConstants.PROGRESS_VIEW_ID); + PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(viewId); } catch (PartInitException e) { - e.printStackTrace(); - throw new GlusterRuntimeException("Could not open the progress view!", e); + String errMsg = "Could not open view [" + viewId + "]"; + logger.error(errMsg, e); + throw new GlusterRuntimeException(errMsg, e); } } + public void showTerminalView() { + //showView("org.eclipse.tm.terminal.view.TerminalView"); + showView(TerminalView.ID); + } + + public void showProgressView() { + showView(IProgressConstants.PROGRESS_VIEW_ID); + } + public void showTaskView() { - try { - NavigationView navigationView = (NavigationView) getView(NavigationView.ID); - navigationView.selectEntity(GlusterDataModelManager.getInstance().getModel().getCluster()); + NavigationView navigationView = (NavigationView) getView(NavigationView.ID); + navigationView.selectEntity(GlusterDataModelManager.getInstance().getModel().getCluster()); - PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() - .showView( TasksView.ID ); - } catch (PartInitException e) { - e.printStackTrace(); - throw new GlusterRuntimeException("Could not open the task progress view!", e); - } + showView(TasksView.ID); } public void setStatusMessage(String message) { diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/ClusterSummaryView.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/ClusterSummaryView.java index c48bfb83..e6ee75ea 100644 --- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/ClusterSummaryView.java +++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/ClusterSummaryView.java @@ -44,7 +44,7 @@ import org.eclipse.ui.part.ViewPart; import com.gluster.storage.management.console.Activator; import com.gluster.storage.management.console.GlusterDataModelManager; import com.gluster.storage.management.console.IImageKeys; -import com.gluster.storage.management.console.actions.IActionConstants; +import com.gluster.storage.management.console.actions.ActionConstants; import com.gluster.storage.management.console.preferences.PreferenceConstants; import com.gluster.storage.management.console.utils.ChartUtil; import com.gluster.storage.management.console.utils.ChartViewerComposite; @@ -287,7 +287,7 @@ public class ClusterSummaryView extends ViewPart { public void linkActivated(HyperlinkEvent e) { IHandlerService hs = (IHandlerService) getSite().getService(IHandlerService.class); try { - hs.executeCommand(IActionConstants.COMMAND_CREATE_VOLUME, null); + hs.executeCommand(ActionConstants.COMMAND_CREATE_VOLUME, null); } catch (Exception e1) { e1.printStackTrace(); } diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/GlusterViewsManager.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/GlusterViewsManager.java index f55e72b9..928bc7fc 100644 --- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/GlusterViewsManager.java +++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/GlusterViewsManager.java @@ -71,7 +71,7 @@ public class GlusterViewsManager implements ViewsManager { private void closeAllViews() { IViewReference[] viewReferences = page.getViewReferences(); for (final IViewReference viewReference : viewReferences) { - if (!viewReference.getId().equals(NavigationView.ID)) { + if (!(viewReference.getId().equals(NavigationView.ID) || viewReference.getId().equals(TerminalView.ID))) { page.hideView(viewReference); } } @@ -80,6 +80,7 @@ public class GlusterViewsManager implements ViewsManager { private void showViewsForCluster(Cluster cluster) throws PartInitException { page.showView(ClusterSummaryView.ID); page.showView(TasksView.ID, null, IWorkbenchPage.VIEW_CREATE); + //page.showView("org.eclipse.tm.terminal.view.TerminalView", null, IWorkbenchPage.VIEW_CREATE); } private void showViewsForVolume(Volume volume) throws PartInitException { diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/TerminalView.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/TerminalView.java new file mode 100644 index 00000000..d99ac513 --- /dev/null +++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/TerminalView.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2011 Gluster, Inc. <http://www.gluster.com> + * This file is part of Gluster Management Console. + * + * Gluster Management Console is free software; you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Gluster Management Console is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License + * for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see + * <http://www.gnu.org/licenses/>. + *******************************************************************************/ +package com.gluster.storage.management.console.views; + +/** + * + */ +public class TerminalView extends org.eclipse.tm.internal.terminal.view.TerminalView { + public static final String ID = TerminalView.class.getName(); +} diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/pages/TasksPage.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/pages/TasksPage.java index 4c399a4c..d54b501d 100644 --- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/pages/TasksPage.java +++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/pages/TasksPage.java @@ -73,7 +73,7 @@ public class TasksPage extends AbstractTableViewerPage<TaskInfo> { tableViewer.remove(taskInfo); parent.update(); // hide the task related actionset as no task is selected - // site.getPage().hideActionSet(IActionConstants.ACTION_SET_TASK); + // site.getPage().hideActionSet(ActionConstants.ACTION_SET_TASK); } @Override diff --git a/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/constants/RESTConstants.java b/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/constants/RESTConstants.java index b4bd7c15..faddb1c6 100644 --- a/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/constants/RESTConstants.java +++ b/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/constants/RESTConstants.java @@ -82,8 +82,8 @@ public class RESTConstants { public static final String FORM_PARAM_FIX_LAYOUT = "fix-layout"; public static final String FORM_PARAM_MIGRATE_DATA = "migrate-data"; public static final String FORM_PARAM_FORCED_DATA_MIGRATE = "forced-data-migrate"; - public static final String FORM_PARAM_OLD_PASSWORD = "oldpassword"; - public static final String FORM_PARAM_NEW_PASSWORD = "newpassword"; + public static final String FORM_PARAM_OLD_PASSWORD = "oldPassword"; + public static final String FORM_PARAM_NEW_PASSWORD = "newPassword"; public static final String PATH_PARAM_FORMAT = "format"; public static final String PATH_PARAM_VOLUME_NAME = "volumeName"; diff --git a/src/com.gluster.storage.management.gateway.scripts/.externalToolBuilders/org.python.pydev.PyDevBuilder.launch b/src/com.gluster.storage.management.gateway.scripts/.externalToolBuilders/org.python.pydev.PyDevBuilder.launch new file mode 100644 index 00000000..1cae618a --- /dev/null +++ b/src/com.gluster.storage.management.gateway.scripts/.externalToolBuilders/org.python.pydev.PyDevBuilder.launch @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType"> +<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="false"/> +<stringAttribute key="org.eclipse.ui.externaltools.ATTR_DISABLED_BUILDER" value="org.python.pydev.PyDevBuilder"/> +<mapAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS"/> +<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/> +</launchConfiguration> diff --git a/src/com.gluster.storage.management.gateway.scripts/.project b/src/com.gluster.storage.management.gateway.scripts/.project index 110db62b..bc0ebd63 100644 --- a/src/com.gluster.storage.management.gateway.scripts/.project +++ b/src/com.gluster.storage.management.gateway.scripts/.project @@ -6,12 +6,17 @@ </projects> <buildSpec> <buildCommand> - <name>org.python.pydev.PyDevBuilder</name> + <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name> + <triggers>full,incremental,</triggers> <arguments> + <dictionary> + <key>LaunchConfigHandle</key> + <value><project>/.externalToolBuilders/org.python.pydev.PyDevBuilder.launch</value> + </dictionary> </arguments> </buildCommand> </buildSpec> <natures> - <nature>org.python.pydev.pythonNature</nature> + <nature>org.eclipse.wst.common.project.facet.core.nature</nature> </natures> </projectDescription> diff --git a/src/com.gluster.storage.management.gateway.scripts/.pydevproject b/src/com.gluster.storage.management.gateway.scripts/.pydevproject deleted file mode 100644 index c327cd69..00000000 --- a/src/com.gluster.storage.management.gateway.scripts/.pydevproject +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<?eclipse-pydev version="1.0"?> - -<pydev_project> -<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property> -<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 3.0</pydev_property> -<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH"> -<path>/com.gluster.storage.management.gateway.scripts/src</path> -</pydev_pathproperty> -</pydev_project> diff --git a/src/com.gluster.storage.management.gateway.scripts/src/backend/add_user_cifs.py b/src/com.gluster.storage.management.gateway.scripts/src/backend/add_user_cifs.py index b2bf045a..2e1a1574 100755 --- a/src/com.gluster.storage.management.gateway.scripts/src/backend/add_user_cifs.py +++ b/src/com.gluster.storage.management.gateway.scripts/src/backend/add_user_cifs.py @@ -37,8 +37,8 @@ def main(): sys.exit(1) except KeyError, e: if Utils.runCommand("groupadd -g %s %s" % (uid, userName)) != 0: - Utils.log("failed to add group %s gid %s\n" % (username, uid)) - sys.stderr.write("Failed to add group %s gid %s\n" % (username, uid)) + Utils.log("failed to add group %s gid %s\n" % (userName, uid)) + sys.stderr.write("Failed to add group %s gid %s\n" % (userName, uid)) sys.exit(2) try: userInfo = pwd.getpwnam(userName) diff --git a/src/com.gluster.storage.management.gateway.scripts/src/backend/get_server_details.py b/src/com.gluster.storage.management.gateway.scripts/src/backend/get_server_details.py index 30ffac58..ecbe1237 100755 --- a/src/com.gluster.storage.management.gateway.scripts/src/backend/get_server_details.py +++ b/src/com.gluster.storage.management.gateway.scripts/src/backend/get_server_details.py @@ -24,6 +24,7 @@ if not p1 in sys.path: sys.path.append(p1) if not p2 in sys.path: sys.path.append(p2) +import dbus import socket import re import Utils @@ -100,11 +101,16 @@ def getServerDetails(listall): responseDom.appendTag(serverTag) serverTag.appendChild(responseDom.createTag("numOfCPUs", int(os.sysconf('SC_NPROCESSORS_ONLN')))) - diskDom = DiskUtils.getDiskDom() + try: + diskDom = DiskUtils.getDiskDom() + except dbus.dbus_bindings.DBusException, e: + sys.stderr.write("Failed to connect HAL to get device details. Please check if HAL services are running\n") + Utils.log("Failed to connect HAL to get device details") + sys.exit(1) if not diskDom: sys.stderr.write("No disk found!") Utils.log("Failed to get disk details") - sys.exit(1) + sys.exit(2) serverTag.appendChild(diskDom.getElementsByTagRoute("disks")[0]) return serverTag diff --git a/src/com.gluster.storage.management.gateway.scripts/src/backend/setup_cifs_config.py b/src/com.gluster.storage.management.gateway.scripts/src/backend/setup_cifs_config.py index 67ce962e..5d5187f4 100755 --- a/src/com.gluster.storage.management.gateway.scripts/src/backend/setup_cifs_config.py +++ b/src/com.gluster.storage.management.gateway.scripts/src/backend/setup_cifs_config.py @@ -85,10 +85,11 @@ def main(): sys.stderr.write("Failed to create samba configuration file %s: %s\n" % (Globals.REAL_SAMBA_CONF_FILE, str(e))) sys.exit(4) - if Utils.runCommand("setsebool -P samba_share_fusefs on") != 0: - Utils.log("failed to set SELinux samba_share_fusefs") - sys.stderr.write("failed to set SELinux samba_share_fusefs\n") - sys.exit(5) + if Utils.runCommand("/usr/sbin/selinuxenabled") == 0: + if Utils.runCommand("setsebool -P samba_share_fusefs on") != 0: + Utils.log("failed to set SELinux samba_share_fusefs") + sys.stderr.write("failed to set SELinux samba_share_fusefs\n") + sys.exit(5) if Utils.runCommand("service smb status") != 0: if Utils.runCommand("service smb start") != 0: diff --git a/src/com.gluster.storage.management.gateway.scripts/src/backend/start_volume_cifs.py b/src/com.gluster.storage.management.gateway.scripts/src/backend/start_volume_cifs.py index 0d09b5eb..e16c87c2 100755 --- a/src/com.gluster.storage.management.gateway.scripts/src/backend/start_volume_cifs.py +++ b/src/com.gluster.storage.management.gateway.scripts/src/backend/start_volume_cifs.py @@ -33,10 +33,11 @@ def main(): Utils.log("Failed to create reexport link %s" % cifsDirName) sys.stderr.write("Failed to create reexport link %s\n" % cifsDirName) sys.exit(2) - if Utils.runCommand("chcon -t samba_share_t %s -h" % cifsDirName) != 0: - Utils.log("Failed to change security context for the link %s" % cifsDirName) - sys.stderr.write("Failed to change security context for the link %s\n" % cifsDirName) - sys.exit(2) + if Utils.runCommand("/usr/sbin/selinuxenabled") == 0: + if Utils.runCommand("chcon -t samba_share_t %s -h" % cifsDirName) != 0: + Utils.log("Failed to change security context for the link %s" % cifsDirName) + sys.stderr.write("Failed to change security context for the link %s\n" % cifsDirName) + sys.exit(2) if not VolumeUtils.includeVolume(volumeName): Utils.log("Failed to include volume for CIFS reexport") sys.stderr.write("Failed to include volume for CIFS reexport\n") diff --git a/src/com.gluster.storage.management.gateway.scripts/src/common/Utils.py b/src/com.gluster.storage.management.gateway.scripts/src/common/Utils.py index 588d52fa..a090eb42 100644 --- a/src/com.gluster.storage.management.gateway.scripts/src/common/Utils.py +++ b/src/com.gluster.storage.management.gateway.scripts/src/common/Utils.py @@ -399,7 +399,7 @@ def _getCpuStatList(): fp.close() return map(float, line.split()[1:5]) except IOError, e: - Utils.log("Failed to open /proc/stat: %s" % str(e)) + log("Failed to open /proc/stat: %s" % str(e)) return None def getCpuUsageAvg(): @@ -1091,7 +1091,7 @@ def getCifsUserUid(userName): content = fp.read() fp.close() except IOError, e: - Utils.log("failed to read file %s: %s" % (Globals.CIFS_USER_FILE, str(e))) + log("failed to read file %s: %s" % (Globals.CIFS_USER_FILE, str(e))) return False for line in content.strip().split(): diff --git a/src/com.gluster.storage.management.gateway/.project b/src/com.gluster.storage.management.gateway/.project index 3e4dc06a..83fea45d 100644 --- a/src/com.gluster.storage.management.gateway/.project +++ b/src/com.gluster.storage.management.gateway/.project @@ -6,11 +6,6 @@ </projects> <buildSpec> <buildCommand> - <name>org.python.pydev.PyDevBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> <name>org.eclipse.wst.jsdt.core.javascriptValidator</name> <arguments> </arguments> diff --git a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/constants/VolumeOptionsDefaults.java b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/constants/VolumeOptionsDefaults.java index 0e008b32..892ebf11 100644 --- a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/constants/VolumeOptionsDefaults.java +++ b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/constants/VolumeOptionsDefaults.java @@ -137,23 +137,27 @@ public class VolumeOptionsDefaults { public List<VolumeOptionInfo> getVolumeOptionsInfo(String clusterName) { String command = "gluster volume set help-xml"; - String output = ""; - VolumeOptionInfoListResponse options = new VolumeOptionInfoListResponse(); GlusterServer onlineServer = clusterService.getOnlineServer(clusterName); try { - output = getVolumeOptionsInfo(onlineServer.getName(), command); - options = parseXML(output); - return options.getOptions(); - } catch (ConnectionException e) { - onlineServer = clusterService.getNewOnlineServer(clusterName); - output = getVolumeOptionsInfo(onlineServer.getName(), command); - options = parseXML(output); - return options.getOptions(); + return getVolumeOptionsInfo(command, onlineServer); } catch (Exception e) { - throw new GlusterRuntimeException("Fetching volume options default failed! [" + e.getMessage() + "]"); + // check if online server has gone offline. If yes, try again one more time. + if (e instanceof ConnectionException || serverUtil.isServerOnline(onlineServer) == false) { + return getVolumeOptionsInfo(command, clusterService.getNewOnlineServer(clusterName)); + } else { + throw new GlusterRuntimeException("Fetching volume options default failed! [" + e.getMessage() + "]"); + } } } + + private List<VolumeOptionInfo> getVolumeOptionsInfo(String command, GlusterServer onlineServer) { + String output; + VolumeOptionInfoListResponse options; + output = getVolumeOptionsInfo(onlineServer.getName(), command); + options = parseXML(output); + return options.getOptions(); + } private String getVolumeOptionsInfo(String serverName, String command) { return serverUtil.executeOnServer(true, serverName, command, diff --git a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/resources/v1_0/GlusterServersResource.java b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/resources/v1_0/GlusterServersResource.java index 90442f4a..dc8fa3dd 100644 --- a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/resources/v1_0/GlusterServersResource.java +++ b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/resources/v1_0/GlusterServersResource.java @@ -210,9 +210,12 @@ public class GlusterServersResource extends AbstractResource { try { glusterUtil.addServer(onlineServer.getName(), serverName); - } catch (ConnectionException e) { - // online server has gone offline! try with a different one. - onlineServer = clusterService.getNewOnlineServer(clusterName); + } catch (Exception e) { + // check if online server has gone offline. If yes, try again one more time. + if (e instanceof ConnectionException || serverUtil.isServerOnline(onlineServer) == false) { + // online server has gone offline! try with a different one. + onlineServer = clusterService.getNewOnlineServer(clusterName); + } if (onlineServer == null) { throw new GlusterRuntimeException("No online server found in cluster [" + clusterName + "]"); } @@ -327,9 +330,12 @@ public class GlusterServersResource extends AbstractResource { try { glusterUtil.removeServer(onlineServer.getName(), serverName); - } catch (ConnectionException e) { - // online server has gone offline! try with a different one. - onlineServer = clusterService.getNewOnlineServer(clusterName, serverName); + } catch (Exception e) { + // check if online server has gone offline. If yes, try again one more time. + if (e instanceof ConnectionException || serverUtil.isServerOnline(onlineServer) == false) { + // online server has gone offline! try with a different one. + onlineServer = clusterService.getNewOnlineServer(clusterName, serverName); + } if (onlineServer == null) { throw new GlusterRuntimeException("No online server found in cluster [" + clusterName + "]"); } diff --git a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/services/GlusterServerService.java b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/services/GlusterServerService.java index c4cf2850..8080df3e 100644 --- a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/services/GlusterServerService.java +++ b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/services/GlusterServerService.java @@ -68,9 +68,12 @@ public class GlusterServerService { try { glusterServers = getGlusterServers(clusterName, onlineServer, fetchDetails, maxCount, previousServerName); - } catch (ConnectionException e) { - // online server has gone offline! try with a different one. - onlineServer = clusterService.getNewOnlineServer(clusterName); + } catch (Exception e) { + // check if online server has gone offline. If yes, try again one more time. + if (e instanceof ConnectionException || serverUtil.isServerOnline(onlineServer) == false) { + // online server has gone offline! try with a different one. + onlineServer = clusterService.getNewOnlineServer(clusterName); + } if (onlineServer == null) { throw new GlusterRuntimeException("No online servers found in cluster [" + clusterName + "]"); } @@ -84,9 +87,12 @@ public class GlusterServerService { List<GlusterServer> glusterServers; try { glusterServers = glusterUtil.getGlusterServers(onlineServer); - } catch (ConnectionException e) { - // online server has gone offline! try with a different one. - onlineServer = clusterService.getNewOnlineServer(clusterName); + } catch (Exception e) { + // check if online server has gone offline. If yes, try again one more time. + if (e instanceof ConnectionException || serverUtil.isServerOnline(onlineServer) == false) { + // online server has gone offline! try with a different one. + onlineServer = clusterService.getNewOnlineServer(clusterName); + } if (onlineServer == null) { throw new GlusterRuntimeException("No online servers found in cluster [" + clusterName + "]"); } @@ -146,9 +152,12 @@ public class GlusterServerService { GlusterServer server = null; try { server = glusterUtil.getGlusterServer(onlineServer, serverName); - } catch (ConnectionException e) { - // online server has gone offline! try with a different one. - onlineServer = clusterService.getNewOnlineServer(clusterName); + } catch (Exception e) { + // check if online server has gone offline. If yes, try again one more time. + if (e instanceof ConnectionException || serverUtil.isServerOnline(onlineServer) == false) { + // online server has gone offline! try with a different one. + onlineServer = clusterService.getNewOnlineServer(clusterName); + } if (onlineServer == null) { throw new GlusterRuntimeException("No online servers found in cluster [" + clusterName + "]"); } diff --git a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/services/VolumeService.java b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/services/VolumeService.java index 69fe01c1..944b29c6 100644 --- a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/services/VolumeService.java +++ b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/services/VolumeService.java @@ -118,14 +118,17 @@ public class VolumeService { List<String> brickList = Arrays.asList(bricks.split(",")); try { glusterUtil.addBricks(volumeName, brickList, onlineServer.getName()); - } catch (ConnectionException e) { - // online server has gone offline! try with a different one. - onlineServer = clusterService.getNewOnlineServer(clusterName); - if (onlineServer == null) { - throw new GlusterRuntimeException("No online servers found in cluster [" + clusterName + "]"); + } catch (Exception e) { + // check if online server has gone offline. If yes, try again one more time. + if (e instanceof ConnectionException || serverUtil.isServerOnline(onlineServer) == false) { + // online server has gone offline! try with a different one. + onlineServer = clusterService.getNewOnlineServer(clusterName); + if (onlineServer == null) { + throw new GlusterRuntimeException("No online servers found in cluster [" + clusterName + "]"); + } + + glusterUtil.addBricks(volumeName, brickList, onlineServer.getName()); } - - glusterUtil.addBricks(volumeName, brickList, onlineServer.getName()); } } @@ -148,11 +151,14 @@ public class VolumeService { volume = glusterUtil.getVolume(volumeName, onlineServer.getName()); // Collect the CIFS users if CIFS Re-exported fetchVolumeCifsUsers(clusterName, volume); - } catch (ConnectionException e) { - // online server has gone offline! try with a different one. - onlineServer = clusterService.getNewOnlineServer(clusterName); - if (onlineServer == null) { - throw new GlusterRuntimeException("No online servers found in cluster [" + clusterName + "]"); + } catch (Exception e) { + // check if online server has gone offline. If yes, try again one more time. + if (e instanceof ConnectionException || serverUtil.isServerOnline(onlineServer) == false) { + // online server has gone offline! try with a different one. + onlineServer = clusterService.getNewOnlineServer(clusterName); + if (onlineServer == null) { + throw new GlusterRuntimeException("No online servers found in cluster [" + clusterName + "]"); + } } volume = glusterUtil.getVolume(volumeName, onlineServer.getName()); // Collect the CIFS users if CIFS Re-exported @@ -193,7 +199,7 @@ public class VolumeService { try { return glusterUtil.getAllVolumes(onlineServer.getName()); - } catch (ConnectionException e) { + } catch (Exception e) { // online server has gone offline! try with a different one. onlineServer = clusterService.getNewOnlineServer(clusterName); if (onlineServer == null) { @@ -368,11 +374,14 @@ public class VolumeService { try { glusterUtil.createVolume(onlineServer.getName(), volumeName, volumeType, transportType, replicaCount, stripeCount, bricks, accessProtocols, options); - } catch (ConnectionException e) { - // online server has gone offline! try with a different one. - onlineServer = clusterService.getNewOnlineServer(clusterName); - if (onlineServer == null) { - throw new GlusterRuntimeException("No online servers found in cluster [" + clusterName + "]"); + } catch (Exception e) { + // check if online server has gone offline. If yes, try again one more time. + if (e instanceof ConnectionException || serverUtil.isServerOnline(onlineServer) == false) { + // online server has gone offline! try with a different one. + onlineServer = clusterService.getNewOnlineServer(clusterName); + if (onlineServer == null) { + throw new GlusterRuntimeException("No online servers found in cluster [" + clusterName + "]"); + } } glusterUtil.createVolume(onlineServer.getName(), volumeName, volumeType, transportType, replicaCount, @@ -629,10 +638,13 @@ public class VolumeService { } performOperation(clusterName, volumeName, operation, onlineServer); - } catch (ConnectionException e) { - // online server has gone offline! try with a different one. - onlineServer = clusterService.getNewOnlineServer(clusterName); - performOperation(clusterName, volumeName, operation, onlineServer); + } catch (Exception e) { + // check if online server has gone offline. If yes, try again one more time. + if (e instanceof ConnectionException || serverUtil.isServerOnline(onlineServer) == false) { + // online server has gone offline! try with a different one. + onlineServer = clusterService.getNewOnlineServer(clusterName); + performOperation(clusterName, volumeName, operation, onlineServer); + } } } @@ -689,9 +701,12 @@ public class VolumeService { private void removeBricks(String clusterName, String volumeName, List<String> brickList, GlusterServer onlineServer) { try { glusterUtil.removeBricks(volumeName, brickList, onlineServer.getName()); - } catch (ConnectionException e) { - // online server has gone offline! try with a different one. - onlineServer = clusterService.getNewOnlineServer(clusterName); + } catch (Exception e) { + // check if online server has gone offline. If yes, try again one more time. + if (e instanceof ConnectionException || serverUtil.isServerOnline(onlineServer) == false) { + // online server has gone offline! try with a different one. + onlineServer = clusterService.getNewOnlineServer(clusterName); + } if (onlineServer == null) { throw new GlusterRuntimeException("No online servers found in cluster [" + clusterName + "]"); } @@ -793,13 +808,16 @@ public class VolumeService { try { glusterUtil.resetOptions(volumeName, onlineServer.getName()); - } catch (ConnectionException e) { - // online server has gone offline! try with a different one. - onlineServer = clusterService.getNewOnlineServer(clusterName); + } catch (Exception e) { + // check if online server has gone offline. If yes, try again one more time. + if (e instanceof ConnectionException || serverUtil.isServerOnline(onlineServer) == false) { + // online server has gone offline! try with a different one. + onlineServer = clusterService.getNewOnlineServer(clusterName); + } if (onlineServer == null) { throw new GlusterRuntimeException("No online servers found in cluster [" + clusterName + "]"); } - + glusterUtil.resetOptions(volumeName, onlineServer.getName()); } } @@ -832,13 +850,16 @@ public class VolumeService { try { glusterUtil.setOption(volumeName, key, value, onlineServer.getName()); - } catch (ConnectionException e) { - // online server has gone offline! try with a different one. - onlineServer = clusterService.getNewOnlineServer(clusterName); + } catch (Exception e) { + // check if online server has gone offline. If yes, try again one more time. + if (e instanceof ConnectionException || serverUtil.isServerOnline(onlineServer) == false) { + // online server has gone offline! try with a different one. + onlineServer = clusterService.getNewOnlineServer(clusterName); + } if (onlineServer == null) { throw new GlusterRuntimeException("No online servers found in cluster [" + clusterName + "]"); } - + glusterUtil.setOption(volumeName, key, value, onlineServer.getName()); } } diff --git a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/tasks/MigrateBrickTask.java b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/tasks/MigrateBrickTask.java index 9dcb38c4..a1fce1eb 100644 --- a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/tasks/MigrateBrickTask.java +++ b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/tasks/MigrateBrickTask.java @@ -20,6 +20,7 @@ */ package com.gluster.storage.management.gateway.tasks; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.web.context.ContextLoader; @@ -30,6 +31,7 @@ import com.gluster.storage.management.core.model.TaskStatus; import com.gluster.storage.management.core.utils.ProcessResult; import com.gluster.storage.management.gateway.services.ClusterService; import com.gluster.storage.management.gateway.utils.GlusterUtil; +import com.gluster.storage.management.gateway.utils.ServerUtil; import com.sun.jersey.core.util.Base64; public class MigrateBrickTask extends Task { @@ -38,6 +40,9 @@ public class MigrateBrickTask extends Task { private String toBrick; private Boolean autoCommit; private GlusterUtil glusterUtil; + + @Autowired + protected ServerUtil serverUtil; public String getFromBrick() { return fromBrick; @@ -89,9 +94,12 @@ public class MigrateBrickTask extends Task { public void start() { try { startMigration(getOnlineServer().getName()); - } catch (ConnectionException e) { - // online server might have gone Offline. try with a new one. - startMigration(getNewOnlineServer().getName()); + } catch (Exception e) { + // check if online server has gone offline. If yes, try again one more time. + if (e instanceof ConnectionException || serverUtil.isServerOnline(getOnlineServer()) == false) { + // online server might have gone Offline. try with a new one. + startMigration(getNewOnlineServer().getName()); + } } } @@ -110,9 +118,12 @@ public class MigrateBrickTask extends Task { public void pause() { try { pauseMigration(getOnlineServer().getName()); - } catch (ConnectionException e) { - // online server might have gone offline. try with a new one. - pauseMigration(getNewOnlineServer().getName()); + } catch (Exception e) { + // check if online server has gone offline. If yes, try again one more time. + if (e instanceof ConnectionException || serverUtil.isServerOnline(getOnlineServer()) == false) { + // online server might have gone offline. try with a new one. + pauseMigration(getNewOnlineServer().getName()); + } } } @@ -138,9 +149,12 @@ public class MigrateBrickTask extends Task { public void commit() { try { commitMigration(getOnlineServer().getName()); - } catch (ConnectionException e) { - // online server might have gone offline. try with a new one. - commitMigration(getNewOnlineServer().getName()); + } catch (Exception e) { + // check if online server has gone offline. If yes, try again one more time. + if (e instanceof ConnectionException || serverUtil.isServerOnline(getOnlineServer()) == false) { + // online server might have gone offline. try with a new one. + commitMigration(getNewOnlineServer().getName()); + } } } @@ -162,9 +176,12 @@ public class MigrateBrickTask extends Task { public void stop() { try { stopMigration(getOnlineServer().getName()); - } catch (ConnectionException e) { - // online server might have gone offline. try with a new one. - stopMigration(getNewOnlineServer().getName()); + } catch (Exception e) { + // check if online server has gone offline. If yes, try again one more time. + if (e instanceof ConnectionException || serverUtil.isServerOnline(getOnlineServer()) == false) { + // online server might have gone offline. try with a new one. + stopMigration(getNewOnlineServer().getName()); + } } } @@ -184,10 +201,14 @@ public class MigrateBrickTask extends Task { public TaskStatus checkStatus() { try { return checkMigrationStatus(getOnlineServer().getName()); - } catch (ConnectionException e) { - // online server might have gone offline. try with a new one. - return checkMigrationStatus(getNewOnlineServer().getName()); + } catch (Exception e) { + // check if online server has gone offline. If yes, try again one more time. + if (e instanceof ConnectionException || serverUtil.isServerOnline(getOnlineServer()) == false) { + // online server might have gone offline. try with a new one. + return checkMigrationStatus(getNewOnlineServer().getName()); + } } + return null; } private TaskStatus checkMigrationStatus(String serverName) { diff --git a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/tasks/RebalanceVolumeTask.java b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/tasks/RebalanceVolumeTask.java index 1be71c0d..8c844f5b 100644 --- a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/tasks/RebalanceVolumeTask.java +++ b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/tasks/RebalanceVolumeTask.java @@ -66,10 +66,13 @@ public class RebalanceVolumeTask extends Task { try { serverName = getOnlineServer().getName(); startRebalance(serverName); - } catch(ConnectionException e) { - // online server might have gone offline. try with a new one - serverName = getNewOnlineServer().getName(); - startRebalance(serverName); + } catch (Exception e) { + // check if online server has gone offline. If yes, try again one more time. + if (e instanceof ConnectionException || serverUtil.isServerOnline(getOnlineServer()) == false) { + // online server might have gone offline. try with a new one + serverName = getNewOnlineServer().getName(); + startRebalance(serverName); + } } } @@ -90,9 +93,12 @@ public class RebalanceVolumeTask extends Task { public void stop() { try { glusterUtil.stopRebalance(serverName, getTaskInfo().getReference()); - } catch (ConnectionException e) { - // online server might have gone offline. update the failure status - getTaskInfo().setStatus(new TaskStatus(new Status(Status.STATUS_CODE_FAILURE, e.getMessage()))); + } catch (Exception e) { + // check if online server has gone offline. If yes, try again one more time. + if (e instanceof ConnectionException || serverUtil.isServerOnline(getOnlineServer()) == false) { + // online server might have gone offline. update the failure status + getTaskInfo().setStatus(new TaskStatus(new Status(Status.STATUS_CODE_FAILURE, e.getMessage()))); + } } } @@ -107,11 +113,15 @@ public class RebalanceVolumeTask extends Task { public TaskStatus checkStatus() { try { return glusterUtil.checkRebalanceStatus(serverName, getTaskInfo().getReference()); - } catch(ConnectionException e) { - // online server might have gone offline. update the failure status - getTaskInfo().setStatus(new TaskStatus(new Status(Status.STATUS_CODE_FAILURE, e.getMessage()))); - return getTaskInfo().getStatus(); + } catch (Exception e) { + // check if online server has gone offline. If yes, try again one more time. + if (e instanceof ConnectionException || serverUtil.isServerOnline(getOnlineServer()) == false) { + // online server might have gone offline. update the failure status + getTaskInfo().setStatus(new TaskStatus(new Status(Status.STATUS_CODE_FAILURE, e.getMessage()))); + return getTaskInfo().getStatus(); + } } + return null; } public void setLayout(String layout) { diff --git a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/utils/ServerUtil.java b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/utils/ServerUtil.java index 9364ea68..e057787f 100644 --- a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/utils/ServerUtil.java +++ b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/utils/ServerUtil.java @@ -99,6 +99,12 @@ public class ServerUtil { server.setDisks(((Server) response).getDisks()); } + public boolean isServerOnline(Server server) { + // fetch latest details and check if server is still online + fetchServerDetails(server); + return server.isOnline(); + } + public String fetchHostName(String serverName) { Object response = fetchServerDetails(serverName); return ((Server) response).getName(); diff --git a/src/com.gluster.storage.management.releng/gluster-management-console.target b/src/com.gluster.storage.management.releng/gluster-management-console.target index 07c580d5..0cf996d8 100644 --- a/src/com.gluster.storage.management.releng/gluster-management-console.target +++ b/src/com.gluster.storage.management.releng/gluster-management-console.target @@ -8,6 +8,7 @@ <location path="target/com.gluster.storage.management.console.target/birt.charts.helios" type="Directory"/> <location path="target/com.gluster.storage.management.console.target/delta.pack.helios" type="Directory"/> <location path="target/com.gluster.storage.management.console.target/org.eclipse.help" type="Directory"/> +<location path="target/com.gluster.storage.management.console.target/org.eclipse.tm.terminal" type="Directory"/> </locations> <targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> </target> |
