Compare commits
829 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 441261bb2f | |||
| 80dbeffa85 | |||
| 39123d48ac | |||
| b8c42d07ae | |||
| 7368174669 | |||
| 3b64245ca6 | |||
| 8311f248fb | |||
| 82b0440a02 | |||
| e889ef17b1 | |||
| a815abaaed | |||
| ec266f7000 | |||
| 4633498a4b | |||
| 0a521cb31a | |||
| 31323d58fa | |||
| a1e1afdb9e | |||
| b0a21076e9 | |||
| 4b5a7005b1 | |||
| 3860a56041 | |||
| 7f5e911c2a | |||
| 180ba59b72 | |||
| 5e5710ad4e | |||
| 79deb0acf5 | |||
| 42cb10b6aa | |||
| 4b8ed14152 | |||
| 4854e5ca69 | |||
| 7f0e7d53ef | |||
| ac5654aae4 | |||
| 1a5bb68586 | |||
| d65d73f9e4 | |||
| fa973b8fd1 | |||
| 2d3d927056 | |||
| d82ee6e7f2 | |||
| e63d9a9967 | |||
| a0bd8f6a46 | |||
| 9d55a3b3c1 | |||
| 34f16337a1 | |||
| 6521a0df7e | |||
| 9af37d48bb | |||
| 7bb0967496 | |||
| 3f8c9bced2 | |||
| 21d1017f86 | |||
| 08a7dc5c78 | |||
| bf2247a181 | |||
| 52e71591be | |||
| b3c477dd6f | |||
| c7cae12392 | |||
| f8c5b0c53b | |||
| 72cbbc912d | |||
| d2f0431829 | |||
| d18d235f1d | |||
| aa1fcd2493 | |||
| ac28aa7e16 | |||
| b8b4c75c39 | |||
| d31122325b | |||
| bc7491ebde | |||
| 3e3eb858e5 | |||
| 55b09cf8b5 | |||
| 15316700a9 | |||
| be879dd88e | |||
| 8c19948f3b | |||
| 4106dec47e | |||
| 7c7b6330ed | |||
| 72c0326c2e | |||
| c1bf69de94 | |||
| 8935e432a2 | |||
| 95cb15d18e | |||
| d1c2a26b2b | |||
| eedb72cac5 | |||
| ae81e14bed | |||
| 1dab5cbb5b | |||
| a10635241e | |||
| fd8ebe93b8 | |||
| 45a2783186 | |||
| 0b1751059b | |||
| 5d5bc70fe8 | |||
| 083154650c | |||
| 44060947cc | |||
| 731a2b9a9d | |||
| 544cabd915 | |||
| 9f8c5f7998 | |||
| 9f20565957 | |||
| bf91d7e939 | |||
| 3af54f8e00 | |||
| 82a094b753 | |||
| b6e445e1f6 | |||
| fb97c85957 | |||
| 4d5c361055 | |||
| f3fce3cbd7 | |||
| f9decc9b87 | |||
| c101ca6858 | |||
| fbd56c732b | |||
| 602f8beb52 | |||
| 734b00e875 | |||
| 2f2a72e90c | |||
| de82de8d87 | |||
| dd87d634e5 | |||
| a2a76f23c6 | |||
| 2f39a9182c | |||
| c94740deb4 | |||
| 5a7e50c1fe | |||
| dab3cf53b0 | |||
| 0857cb241a | |||
| 27085c3af0 | |||
| 1664ed82d8 | |||
| 6ee370cfbe | |||
| 4488357171 | |||
| b99460f24f | |||
| 7d9a0ad0ed | |||
| 3c84558504 | |||
| f891cc995b | |||
| 46c40ab353 | |||
| a2656b7645 | |||
| ba94317016 | |||
| f8f797bc57 | |||
| 08bfa000a6 | |||
| 980c22d787 | |||
| e83a221388 | |||
| 209b9202b7 | |||
| 7640137f02 | |||
| 11c7894e6f | |||
| 70cf9e5790 | |||
| b549c9b8e4 | |||
| e51af68867 | |||
| 254643a5c7 | |||
| 84b1fb6a79 | |||
| 68d2993a78 | |||
| 8b4c3c074b | |||
| 086c91877e | |||
| 259767a305 | |||
| c4331e85c6 | |||
| a585170667 | |||
| ba244e8841 | |||
| 1dac16d2ce | |||
| 2a241d4e64 | |||
| 5b3f372056 | |||
| 1dd54b108d | |||
| 94511e23c0 | |||
| 8947e743a1 | |||
| da0a0d9555 | |||
| 273bac6e72 | |||
| e680150395 | |||
| df3f6b7ffb | |||
| d7051e1bde | |||
| b44c562e4e | |||
| 4018deb485 | |||
| c4e78295ff | |||
| d37b7dd8f4 | |||
| 8f4cb07057 | |||
| 4ba6342bc7 | |||
| 451d63d075 | |||
| ba23720d6f | |||
| b733ed7993 | |||
| ab8527103f | |||
| 2c76dc1011 | |||
| d38374d1c2 | |||
| fd9e4f96ce | |||
| b8f5208ef0 | |||
| 108d40c7dc | |||
| ccf619ce12 | |||
| b390df9313 | |||
| ce8f2e5282 | |||
| ba38665c4e | |||
| b6629f4e61 | |||
| 2220d60168 | |||
| 2165956209 | |||
| 32a15b987a | |||
| 406346f2a6 | |||
| 7317419c92 | |||
| 98f2a6dd5b | |||
| a000d5f80b | |||
| 94e3862219 | |||
| 19b413af7f | |||
| c418b962ba | |||
| 20140c5c8f | |||
| 13016f8817 | |||
| a3476dd281 | |||
| a270d82762 | |||
| 63c773dd53 | |||
| 1254f86a45 | |||
| d8442c35e2 | |||
| 29e60c243e | |||
| 70c5242f77 | |||
| 71062b78d9 | |||
| 5a10afcb2d | |||
| 056f824b02 | |||
| 0d46150fcc | |||
| 664a1e0f74 | |||
| 405ad47b44 | |||
| a4119f52a2 | |||
| 9a014e31c3 | |||
| 88d34addd0 | |||
| ede6f9a65a | |||
| 901e60d507 | |||
| d14d92acf0 | |||
| c7dcb9160c | |||
| b7e4a65913 | |||
| 468644eee4 | |||
| 207fafea58 | |||
| 49787e5842 | |||
| 1e09d79d7f | |||
| d837e1fea0 | |||
| e31e02650d | |||
| b2c1c84696 | |||
| f2744659a7 | |||
| e925929f1a | |||
| 8c5ed18ffe | |||
| fd83987b66 | |||
| a55f3461d5 | |||
| f5f4e1117d | |||
| 895f3c7673 | |||
| 9122b91ca2 | |||
| 1ad82ecc82 | |||
| af69e64ca5 | |||
| affe91b7d3 | |||
| e7f3c4dcfe | |||
| d9af0e6c67 | |||
| af74d4fa22 | |||
| 0dc7190796 | |||
| 759cea4c03 | |||
| 7250b6595a | |||
| 65e870c0e8 | |||
| f94475e615 | |||
| 83e88eac4b | |||
| acaefeedda | |||
| d3b955caed | |||
| a5b5cc1c8b | |||
| 632e27647c | |||
| 434a530bbb | |||
| 6378d1ecbb | |||
| 5fd9e8448f | |||
| f528c39823 | |||
| 9742daa508 | |||
| 9f6f9c9ba1 | |||
| 9718f7161e | |||
| d7ff87a006 | |||
| 4e0224fc07 | |||
| c508d0bbbd | |||
| d2044c61f2 | |||
| 77ff664eb0 | |||
| a2b505be1c | |||
| 7cd9df23fb | |||
| 5bc4867f00 | |||
| 5f576615a1 | |||
| bbcf107b6a | |||
| 59a83730a4 | |||
| 036533351b | |||
| 477d41591e | |||
| c027734b2c | |||
| dd5b8103d7 | |||
| 4522feaa4f | |||
| 41fbf85cb8 | |||
| 1a0f0a90b0 | |||
| 41d0e37a84 | |||
| 5f58bb8dc8 | |||
| c45549830f | |||
| 881c1daa47 | |||
| 0bfe50eaa2 | |||
| 581a5d3757 | |||
| f914f11de9 | |||
| b3b3d3401c | |||
| 8509f7af39 | |||
| 91ae5f3edd | |||
| 50feb83e56 | |||
| 2d49286342 | |||
| ed6dfea685 | |||
| 70786f3d53 | |||
| e475a8b693 | |||
| 7442dd8413 | |||
| 31c60fc35f | |||
| 230625f4f6 | |||
| b021dee141 | |||
| b3bf58c236 | |||
| ada63f1faf | |||
| 14e605511d | |||
| 5bd77c3382 | |||
| c518a61f69 | |||
| 7fb96a1b9f | |||
| 7c0744d25a | |||
| 8e08d966ee | |||
| 2fdf9dc8c7 | |||
| 5cc6c961e5 | |||
| ece4a78fe4 | |||
| 49d8bf9f15 | |||
| 614b0bc0a9 | |||
| 1ab0ea3f0e | |||
| 8a13ae9151 | |||
| f3cc830095 | |||
| d6372084a7 | |||
| 3d8d27f48b | |||
| 78133aa3bb | |||
| 81dbcb740b | |||
| 7fb346f9ae | |||
| 8587a835fd | |||
| 6a1c104f66 | |||
| 7e34083819 | |||
| c454f53c75 | |||
| f5c785ba23 | |||
| bdd737a482 | |||
| 67ac470c5a | |||
| 6adb4327a0 | |||
| c1863f23e1 | |||
| 3ab8f9db04 | |||
| 9e72871b81 | |||
| d2dc594434 | |||
| 08919eda58 | |||
| 1c9a36d74c | |||
| d6e8424836 | |||
| af362d39fa | |||
| 5af109fed3 | |||
| dd943d36b3 | |||
| fb20194388 | |||
| 321db70ad1 | |||
| 09938be4d8 | |||
| 0a83ee6596 | |||
| 0317dd05bf | |||
| 1e4d543cf7 | |||
| f0e3791a45 | |||
| ae1df250b2 | |||
| 901468467d | |||
| c67d271b75 | |||
| af638cb809 | |||
| e9dd327f23 | |||
| fa02a0dd58 | |||
| f897724e5c | |||
| 975d448244 | |||
| c6e7fb8ce8 | |||
| 927df81422 | |||
| 4d95ec7969 | |||
| 0ee40f1aa5 | |||
| d373e3f456 | |||
| a150ad3ee2 | |||
| 6df7a8ce12 | |||
| 46d4c8fb45 | |||
| fb045361a5 | |||
| 206746b6c1 | |||
| 1115edcc77 | |||
| b403f7310c | |||
| acf129beaa | |||
| 24a20072ff | |||
| 71add678c3 | |||
| 1184212598 | |||
| 4505e8a91e | |||
| 0a3b830c83 | |||
| 76cc48da87 | |||
| 756378c0c3 | |||
| e89b79bcac | |||
| ff4c96376c | |||
| c7caefc2be | |||
| de6c531090 | |||
| ec2e1f2e5f | |||
| c79bcd7061 | |||
| 7586f27191 | |||
| 931e3e2059 | |||
| aacb5278c7 | |||
| c12c811738 | |||
| 7d3d5f6e83 | |||
| 61001a5e40 | |||
| e7fb61e2ba | |||
| 0436357081 | |||
| b6369a7638 | |||
| 1dc4df9e61 | |||
| 832571e724 | |||
| 00b344d8d0 | |||
| 1d76faed56 | |||
| 88281e0558 | |||
| 070e8975b2 | |||
| f17eed25e4 | |||
| 2f18ec4f7f | |||
| 5a0b29f758 | |||
| e4196ab2cb | |||
| ecde4d3f0b | |||
| 74166dae00 | |||
| 029623589a | |||
| e2e71fe5a5 | |||
| cd9a117e07 | |||
| f344b40856 | |||
| 6b2e3bafa8 | |||
| 89a9713be3 | |||
| f84952c674 | |||
| d79a8413f2 | |||
| af880698b3 | |||
| b06ae22ded | |||
| 5579e698ee | |||
| d0d9e7562d | |||
| 167238f43c | |||
| ce07ccbbcc | |||
| 86acca4d8a | |||
| e0c412f1e0 | |||
| 264e65ad20 | |||
| 319fc2df0f | |||
| 5b91dd6dbe | |||
| 8d68b26c80 | |||
| 63428c2c34 | |||
| 50b110f0ec | |||
| 248de38a9f | |||
| c686ea7a85 | |||
| 0b918e1761 | |||
| 3b2e1cbb91 | |||
| df78ea0e51 | |||
| fea288d4da | |||
| 27088833fe | |||
| 74f825bdbb | |||
| 5728b4defa | |||
| 4837a8831c | |||
| 41c11b4ac5 | |||
| 446d5225d6 | |||
| 6781104527 | |||
| fe2c2ae016 | |||
| c763c84abf | |||
| aea1618f0e | |||
| 475e6c51df | |||
| 7cc740d191 | |||
| 06b056fff6 | |||
| 994846f2b5 | |||
| 4de9a682b9 | |||
| 6404d01f22 | |||
| 482febd6e0 | |||
| 9cc489fbe1 | |||
| 6d4ec668cb | |||
| bbbd6f0133 | |||
| eb83262f4f | |||
| 6bbe69d680 | |||
| 1343fe6240 | |||
| 6691f1a6a5 | |||
| 31af2c1abe | |||
| 3eb9eb7db4 | |||
| 14d8515559 | |||
| 566f801972 | |||
| 8c73c1a3c8 | |||
| d35ff774bf | |||
| bf8b2d03e7 | |||
| bff0e289ca | |||
| 89c9bed215 | |||
| e01f51e8d5 | |||
| 276f492fd9 | |||
| 0b08a005db | |||
| a973a2c72a | |||
| 6c89f08856 | |||
| efc95378d8 | |||
| 16f1ccd713 | |||
| b1bb24b8eb | |||
| 97c9609793 | |||
| b64c53fb89 | |||
| 07dbe567b1 | |||
| 7f60717bda | |||
| fcc2078d54 | |||
| 5681fe9fe7 | |||
| 561bafb554 | |||
| 6b17144d16 | |||
| 346a03ba5d | |||
| bf86ee1a8a | |||
| 4efe8bb389 | |||
| 684d24db62 | |||
| b7f6051be2 | |||
| f44e74a51f | |||
| 63edb798e9 | |||
| c7c57c3914 | |||
| f6fed410e8 | |||
| 7dc173a961 | |||
| cb995a801a | |||
| 71a904afc7 | |||
| 6fa950c8e4 | |||
| 6145f30b34 | |||
| 7aeaa89a46 | |||
| b413e1b33d | |||
| 7e0871c456 | |||
| 6546665c29 | |||
| b45e5f91d1 | |||
| aa1a5f9b35 | |||
| 694f5878f8 | |||
| e4243312d5 | |||
| 3f7ed4dc69 | |||
| 626ed401d6 | |||
| 264668c85f | |||
| e254505337 | |||
| d589de6402 | |||
| 3c0dd360f5 | |||
| ced01fbac9 | |||
| 201e55a8bc | |||
| 40305a94b4 | |||
| 058b8950ab | |||
| daec39d3a2 | |||
| eb1bf16b15 | |||
| 6720e7900c | |||
| 8066590efc | |||
| 8eb33d24d7 | |||
| 28c28bb9d2 | |||
| d799735f35 | |||
| 704ef6932c | |||
| 302269ea3f | |||
| 22b551750e | |||
| 1b14168c84 | |||
| 91fd0975a5 | |||
| a8e56c8263 | |||
| c02fa63c57 | |||
| e359650e27 | |||
| 413b5ce1f6 | |||
| 786c0b9a20 | |||
| b10ad91d3c | |||
| fc92c7844a | |||
| 2eb0e018b3 | |||
| a395272078 | |||
| 077a5e2901 | |||
| 1cd1a8388c | |||
| f4e5b2e9e0 | |||
| 98e9f25aaf | |||
| 79d57e9c49 | |||
| d7a20623d8 | |||
| 12910722b5 | |||
| f01e654001 | |||
| df89dee4c6 | |||
| c122edd400 | |||
| 2ff852b466 | |||
| 2ce7244782 | |||
| eff23d4a3e | |||
| f35700c82e | |||
| d3e17f1988 | |||
| 710fd4029b | |||
| 0d8cf20521 | |||
| 49b144c012 | |||
| df535ce36d | |||
| 305559f05b | |||
| 778ccc9e03 | |||
| fc0047db9e | |||
| f362b67fdb | |||
| 8e48144ba3 | |||
| 98ab033cd4 | |||
| 47b13acc30 | |||
| 775bcb5b9a | |||
| e2dba9bfb8 | |||
| 64075a7d62 | |||
| 566349a967 | |||
| c314602e1b | |||
| 1ea8c0a043 | |||
| bdc005b7a7 | |||
| 390a5aac46 | |||
| 3641d4d290 | |||
| f34350fd51 | |||
| 974fbdbe97 | |||
| 389575a2e6 | |||
| c9e5ed1690 | |||
| 03c9080081 | |||
| 9ccc5d8def | |||
| 100b7a55d7 | |||
| 63d44bec99 | |||
| 4434a60729 | |||
| 09291d399f | |||
| 5c17e658ce | |||
| c797b691a6 | |||
| 80dcea738a | |||
| 2fb15fdecb | |||
| e1fc1437cd | |||
| 8159dfd0fd | |||
| 680ef06b3c | |||
| 59ae04e6da | |||
| 72817fcb81 | |||
| 4b4f8fac6b | |||
| 04ba40f28b | |||
| 9b335ce93c | |||
| 096681629d | |||
| 4ca2beecbf | |||
| 02ee2e25d9 | |||
| a47b354c3e | |||
| f090ea93c7 | |||
| 17f21f23dd | |||
| fe8752991b | |||
| 86d96195bf | |||
| 236888437d | |||
| ddf754b1e8 | |||
| 0e095151f0 | |||
| 0e1efe855e | |||
| 09141b389f | |||
| 1d6ba5855d | |||
| be3374506d | |||
| 3ab8b8990a | |||
| 3c416a4004 | |||
| 772c55f8a8 | |||
| 95eb74c115 | |||
| a7e4ef2bf1 | |||
| deb0391464 | |||
| 9550cef71d | |||
| 07063e64cd | |||
| e32c79ea02 | |||
| cdd5887194 | |||
| fbb1964488 | |||
| e971db6635 | |||
| 62149ffeab | |||
| c1ae76f7dc | |||
| e33a93d24a | |||
| 18e3c0ef2b | |||
| b163fdd290 | |||
| 0db0602cd6 | |||
| 17de2c7ae5 | |||
| f083340825 | |||
| 5795e2a5ea | |||
| 44a319233a | |||
| 55a23d07cf | |||
| 208bd7667a | |||
| d112125042 | |||
| 3f98aa66de | |||
| b9ab9c9ab0 | |||
| 80d2041941 | |||
| 8a478034cb | |||
| c2f1d848ff | |||
| aa3250fa44 | |||
| c44a1ec540 | |||
| 07bfea4df4 | |||
| 5ebe7d4122 | |||
| ad9443ab47 | |||
| 58048a474f | |||
| e48bc39c2b | |||
| bf88e7052f | |||
| 097c51149c | |||
| 9b4a8ccb52 | |||
| 1db4ae7592 | |||
| 7842d3d16d | |||
| 6d01963146 | |||
| fd6ca4e8d6 | |||
| d7eb796165 | |||
| adeef7b545 | |||
| 247e71445a | |||
| 8b64d60620 | |||
| a2fdef3d22 | |||
| 5b8620cdae | |||
| 7e30690442 | |||
| 3b3ce1f894 | |||
| 57e4d2e508 | |||
| a8db7806d5 | |||
| 15b060bf31 | |||
| fed7b1e8ad | |||
| d8bb801422 | |||
| 682d8ec0df | |||
| d3789253c0 | |||
| b1c7d3d59d | |||
| 3660e5d52d | |||
| 5c1345efb6 | |||
| 795a6ed852 | |||
| bc8a686c01 | |||
| d6e715d8be | |||
| 452806fff5 | |||
| 6f33b95718 | |||
| 707353d7a4 | |||
| f26491b055 | |||
| 7f02840237 | |||
| 0d1e0e5bd8 | |||
| 0a424f7464 | |||
| a75db50804 | |||
| 6e649a1bee | |||
| 0cbce7857d | |||
| 2192a7602d | |||
| 8957491f43 | |||
| abc58b4129 | |||
| 34958c9a33 | |||
| 939d35a0fe | |||
| 4b1ffd819e | |||
| 15abf7288b | |||
| 3e3f0e19b0 | |||
| cc606e9a7e | |||
| f56a602a71 | |||
| 8296ff33c1 | |||
| 6f34d48d61 | |||
| d28a567b55 | |||
| 6330c7b0ef | |||
| 3541b8b1cc | |||
| 7db647ebaa | |||
| 7c6b786a97 | |||
| d418f0242b | |||
| 5ff7dcad8d | |||
| 8d74c64821 | |||
| 9bda95f579 | |||
| 5cfc522107 | |||
| a60e0144c1 | |||
| fdd8fb24fd | |||
| 8b06f55eb8 | |||
| 843c7c1d5d | |||
| 87e4b0c226 | |||
| df5fafd11d | |||
| fed8cd7685 | |||
| 28ffd3d30d | |||
| a35c04455a | |||
| 56d219f881 | |||
| 2121f70ebe | |||
| a1705dc258 | |||
| 978d0e5876 | |||
| 4a3676c987 | |||
| fbd9d250d3 | |||
| 800370a96a | |||
| a446cc3054 | |||
| 57244d37ef | |||
| 6c70f1ce4e | |||
| 20a8d6583e | |||
| 593f2ee2c9 | |||
| 6d78e6aeb7 | |||
| 3b615c77c2 | |||
| 02673d9bac | |||
| 8112759c2f | |||
| 57518648b9 | |||
| e4712c5a5b | |||
| 9d9d849cc3 | |||
| 833976f525 | |||
| 48dc9306ec | |||
| 9c6cc52d49 | |||
| c5c13da285 | |||
| 48a70986b7 | |||
| 1e3916352e | |||
| 91150288aa | |||
| 9f34f9989b | |||
| d401f59d7f | |||
| dd953a1d17 | |||
| 45f6284891 | |||
| 99af6b0de6 | |||
| 7229fc1501 | |||
| 4e27d62953 | |||
| 4d4bd8bba5 | |||
| 50e4c46d4f | |||
| b03e4f2b33 | |||
| ffa7c5942a | |||
| 0ab7c79a91 | |||
| 755bb7ca8e | |||
| 3beebf6ccb | |||
| 0dfad6d08a | |||
| aa42b86b24 | |||
| 7c93367b42 | |||
| 85a99288d4 | |||
| 9a0840e5bb | |||
| 620d2a4ff7 | |||
| f442fe034d | |||
| 312c17e2c5 | |||
| e4d9ae9955 | |||
| f0951d09f0 | |||
| c3f6fde2fc | |||
| 776a6f936d | |||
| dabda08b40 | |||
| 807f563d11 | |||
| 101ac6c3aa | |||
| 4e5597ce72 | |||
| f42e832599 | |||
| cdedc212fe | |||
| 29ce8ffd81 | |||
| 23a37e993d | |||
| aa0c1698e5 | |||
| f9715aaebb | |||
| 4b67f2df5e | |||
| 4f7ecb3202 | |||
| 5b31caf7ac | |||
| 5a924514d2 | |||
| 26c633ad65 | |||
| 988ea46a25 | |||
| d66a5fa15b | |||
| 01a79ef71e | |||
| f47240a349 | |||
| fb9ac6c45c | |||
| 8fc204c7b1 | |||
| 97f5def116 | |||
| a2d14e557e | |||
| 3cc2e2ff42 | |||
| cbc2d07d59 | |||
| 6a4febe201 | |||
| 8aef3e9e81 | |||
| 70cb145a71 | |||
| 05f96f37a6 | |||
| 26bf6e2641 | |||
| a4c4d6b1bb | |||
| b81df35469 | |||
| 68e575a69d | |||
| 01a0cec3e7 | |||
| dacd2690c4 | |||
| 2f1b7d8fb6 | |||
| 057b9e72ef | |||
| d597130b9b | |||
| c18868d850 | |||
| af3ed02824 | |||
| ee107f1f51 | |||
| 661484b4c1 | |||
| 82c5ed555f | |||
| 7bed33128a | |||
| 0deb64b53a | |||
| bd4af1093f | |||
| 03ccf3c095 | |||
| ddf0b1ae4c | |||
| 1dfaa46360 | |||
| 9d9c0e34b9 | |||
| 988b15d7f1 | |||
| 4ee0d8586c | |||
| cc8a9e645e | |||
| 690377bc42 | |||
| 413dd37b21 | |||
| eab6f3e3fc | |||
| 658c947ca6 | |||
| 1a33167500 | |||
| 590061470b | |||
| 0311b2a153 | |||
| 97f09d34d4 | |||
| 2c89d9d93a | |||
| a18ae5b90d | |||
| 69a57acdd2 | |||
| 1868e85c57 | |||
| 31ca57bcfe | |||
| 9f87a1d437 | |||
| fa625d5ee3 | |||
| 926c88c43e | |||
| e7a7110d90 | |||
| a056b3545c | |||
| 06ce5ebcde | |||
| 8319b93f7d | |||
| 6f381c4c06 | |||
| 3999e51990 | |||
| d98365a5c1 | |||
| f71fcc1417 | |||
| 037b2f3ebd | |||
| e6eb66e24b | |||
| e27ed6274b | |||
| 3438dcda53 | |||
| 903e828ea2 | |||
| 4410c8b363 | |||
| a6a8f4496e | |||
| f61ccd70f3 | |||
| 30c1692f78 | |||
| c18b4d630d | |||
| f431dc1800 | |||
| 65e98ce27d | |||
| 70d0d7a9c9 | |||
| 394a9e21aa | |||
| b0865ca040 | |||
| 9863bd83d8 | |||
| c1a4a2b7a6 | |||
| 6c35430c8c | |||
| 3333e8d7fd | |||
| 5bc8f7bd96 |
@@ -7,8 +7,3 @@ xCAT documentation is available at: http://xcat.sourceforge.net/
|
||||
xCAT is made available as open source software under the EPL license:
|
||||
http://www.opensource.org/licenses/eclipse-1.0.php
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,241 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Update GSA Ubuntu Repositories or create a local repository
|
||||
#
|
||||
# Author: Leonardo Tonetto (tonetto@linux.vnet.ibm.com)
|
||||
# Revisor: Arif Ali (aali@ocf.co.uk)
|
||||
#
|
||||
# After running this script, add the following line to
|
||||
# /etc/apt/sources.list for local repository
|
||||
# deb file://<core_repo_path>/xcat-core/ maverick main
|
||||
# deb file://<dep_repo_path>/xcat-dep/ maverick main
|
||||
#
|
||||
|
||||
# For the purpose of getting the distribution name
|
||||
|
||||
# Supported distributions
|
||||
dists="squeeze"
|
||||
|
||||
a_flag= # automatic flag - only update if repo was updated
|
||||
c_flag= # xcat-core (trunk-delvel) path
|
||||
d_flag= # xcat-dep (trunk) path
|
||||
local_flag= # build the repository localy
|
||||
|
||||
while getopts 'c:d:u:p:l:a' OPTION
|
||||
do
|
||||
case $OPTION in
|
||||
c) c_flag=1
|
||||
xcat_core_path="$OPTARG"
|
||||
;;
|
||||
d) d_flag=1
|
||||
xcat_dep_path="$OPTARG"
|
||||
;;
|
||||
l) local_flag=1
|
||||
local_repo_path="$OPTARG"
|
||||
;;
|
||||
a) a_flag=1
|
||||
;;
|
||||
|
||||
?) printf "Usage: %s -c <core_trunk_path> [-d <dep_trunk_path>] -l <local-repo_path> [-a]\n" $(basename $0) >&2
|
||||
echo "-a Automatic: update only if there's any update on repo"
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $(($OPTIND - 1))
|
||||
|
||||
if [ -z "$c_flag" -a -z "$d_flag" ]
|
||||
then
|
||||
printf "Usage: %s -c <core_trunk_path> [-d <dep_trunk_path>] { -l <local-repo_path> | [-u <gsa_id> -p <gsa_passwd>] } [-a]\n" $(basename $0) >&2
|
||||
echo "-a Automatic: update only if there's any update on repo"
|
||||
exit 2
|
||||
fi
|
||||
if [ ! -d $xcat_core_path ]
|
||||
then
|
||||
printf "%s: No such directory\n" "$xcat_core_path" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [ "$d_flag" ]
|
||||
then
|
||||
if [ ! -d $xcat_dep_path ]
|
||||
then
|
||||
printf "%s: No such directory\n" "$xcat_dep_path" >&2
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$local_flag" ]
|
||||
then
|
||||
repo_xcat_core_path=$local_repo_path"/xcat-core"
|
||||
repo_xcat_dep_path=$local_repo_path"/xcat-dep"
|
||||
else
|
||||
printf "Usage: %s -c <core_trunk_path> [-d <dep_trunk_path>] -l <local-repo_path> [-a]\n" $(basename $0) >&2
|
||||
echo "-a Automatic: update only if there's any update on repo"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [ "$a_flag" ]
|
||||
then
|
||||
touch svcupdate.trace
|
||||
SVCUP='svcupdate.trace'
|
||||
svn update $xcat_core_path 1> $SVCUP 2>&1
|
||||
if ! grep 'Tree is up to date' $SVCUP
|
||||
then
|
||||
update_core=1
|
||||
else
|
||||
update_core=
|
||||
fi
|
||||
rm -f $SVCUP
|
||||
else
|
||||
update_core=1
|
||||
fi
|
||||
if [ "$c_flag" -a "$update_core" ]
|
||||
then
|
||||
echo "###############################"
|
||||
echo "# Building xcat-core packages #"
|
||||
echo "###############################"
|
||||
|
||||
CMD_PATH=`pwd`
|
||||
cd $xcat_core_path
|
||||
./build-debs-all "snap" "Nightly_Builds"
|
||||
|
||||
echo "#################################"
|
||||
echo "# Creating xcat-core repository #"
|
||||
echo "#################################"
|
||||
|
||||
if [ -d $repo_xcat_core_path ]; then
|
||||
rm -rf $repo_xcat_core_path
|
||||
fi
|
||||
mkdir -p $repo_xcat_core_path/conf
|
||||
|
||||
find . -iname '*.deb' -exec mv {} $repo_xcat_core_path \;
|
||||
|
||||
rm -rf debs/
|
||||
cd $CMD_PATH
|
||||
|
||||
rm -rf $repo_xcat_core_path/conf/distributions
|
||||
|
||||
for dist in $dists; do
|
||||
cat << __EOF__ >> $repo_xcat_core_path/conf/distributions
|
||||
Origin: xCAT internal repository
|
||||
Label: xcat-core bazaar repository
|
||||
Codename: $dist
|
||||
Architectures: amd64
|
||||
Components: main
|
||||
Description: Repository automatically genereted conf
|
||||
|
||||
__EOF__
|
||||
done
|
||||
|
||||
cat << __EOF__ > $repo_xcat_core_path/conf/options
|
||||
verbose
|
||||
basedir .
|
||||
__EOF__
|
||||
|
||||
for dist in $dists; do
|
||||
for file in `ls $repo_xcat_core_path/*.deb`; do
|
||||
reprepro -b $repo_xcat_core_path includedeb $dist $file;
|
||||
done
|
||||
done
|
||||
|
||||
mv $xcat_core_path/latest_version $repo_xcat_core_path/xcat-core_latest-build
|
||||
|
||||
cat << '__EOF__' > $repo_xcat_core_path/mklocalrepo.sh
|
||||
codename=`lsb_release -a 2>null | grep Codename | awk '{print $2}'`
|
||||
cd `dirname $0`
|
||||
echo deb file://"`pwd`" $codename main > /etc/apt/sources.list.d/xcat-core.list
|
||||
__EOF__
|
||||
|
||||
chmod 775 $repo_xcat_core_path/mklocalrepo.sh
|
||||
rm -rf $repo_xcat_core_path/*.deb
|
||||
|
||||
if [ -z "$local_flag" ]
|
||||
then
|
||||
echo "###############################"
|
||||
echo "# Updating GSA xcat-core repo #"
|
||||
echo "###############################"
|
||||
lftp -e "mirror -R --delete-first $repo_xcat_core_path /projects/i/ipl-xcat/ubuntu/; exit;" -u $gsa_id,$gsa_passwd -p 22 sftp://ausgsa.ibm.com
|
||||
fi ### if [ -z "$local_flag" ]
|
||||
fi ### if [ "$a_flag" ]
|
||||
|
||||
if [ "$a_flag" -a "$d_flag" ]
|
||||
then
|
||||
touch svcupdate.trace
|
||||
SVCUP='svcupdate.trace'
|
||||
svn update $xcat_dep_path 1> $SVCUP 2>&1
|
||||
if ! grep 'Tree is up to date' $SVCUP
|
||||
then
|
||||
update_dep=1
|
||||
else
|
||||
update_dep=
|
||||
fi
|
||||
rm -f $SVCUP
|
||||
else
|
||||
update_dep=1
|
||||
fi
|
||||
if [ "$d_flag" -a "$update_dep" ]
|
||||
then
|
||||
echo "##############################"
|
||||
echo "# Building xcat-dep packages #"
|
||||
echo "##############################"
|
||||
|
||||
CMD_PATH=`pwd`
|
||||
cd $xcat_dep_path
|
||||
./build-debs-all "snap" "Nightly_Builds"
|
||||
|
||||
echo "################################"
|
||||
echo "# Creating xcat-dep repository #"
|
||||
echo "################################"
|
||||
rm -rf $repo_xcat_dep_path
|
||||
mkdir -p $repo_xcat_dep_path/conf
|
||||
find $xcat_dep_path -iname '*.deb' -exec cp {} $repo_xcat_dep_path \;
|
||||
|
||||
rm -rf $repo_xcat_core_path/conf/distributions
|
||||
|
||||
for dist in $dists; do
|
||||
cat << __EOF__ >> $repo_xcat_dep_path/conf/distributions
|
||||
Origin: xCAT internal repository
|
||||
Label: xcat-dep bazaar repository
|
||||
Codename: $dist
|
||||
Architectures: amd64
|
||||
Components: main
|
||||
Description: Repository automatically genereted conf
|
||||
|
||||
__EOF__
|
||||
done
|
||||
|
||||
cat << __EOF__ > $repo_xcat_dep_path/conf/options
|
||||
verbose
|
||||
basedir .
|
||||
__EOF__
|
||||
|
||||
for dist in $dists; do
|
||||
for file in `ls $repo_xcat_dep_path/*.deb`; do
|
||||
reprepro -b $repo_xcat_dep_path includedeb $dist $file;
|
||||
done
|
||||
done
|
||||
|
||||
cat << '__EOF__' > $repo_xcat_dep_path/mklocalrepo.sh
|
||||
codename=`lsb_release -a 2>null | grep Codename | awk '{print $2}'`
|
||||
cd `dirname $0`
|
||||
echo deb file://"`pwd`" $codename main > /etc/apt/sources.list.d/xcat-dep.list
|
||||
__EOF__
|
||||
|
||||
chmod 775 $repo_xcat_dep_path/mklocalrepo.sh
|
||||
rm -rf $repo_xcat_dep_path/*.deb
|
||||
|
||||
if [ -z "$local_flag" ]
|
||||
then
|
||||
echo "##############################"
|
||||
echo "# Updating GSA xcat-dep repo #"
|
||||
echo "##############################"
|
||||
lftp -e "mirror -R --delete-first $repo_xcat_dep_path /projects/i/ipl-xcat/ubuntu/; exit;" -u $gsa_id,$gsa_passwd -p 22 sftp://ausgsa.ibm.com
|
||||
fi ### if [ -z "$local_flag" ]
|
||||
fi ### if [ "$d_flag" -a "$a_flag"]
|
||||
|
||||
if [ -z "$local_flag" ] # delete the temp repo after upload is done
|
||||
then
|
||||
rm -rf ./gsa-repo_temp
|
||||
fi
|
||||
|
||||
exit 0
|
||||
+11
-10
@@ -6,7 +6,6 @@
|
||||
#
|
||||
# Author: Leonardo Tonetto <tonetto@linux.vnet.ibm.com>
|
||||
# Revisor: Adalberto Medeiros <adalbas@linux.vnet.ibm.com>
|
||||
# Revisor2: Arif Ali <aali@ocf.co.uk>
|
||||
#
|
||||
# Input:
|
||||
#
|
||||
@@ -30,7 +29,7 @@ fi
|
||||
XCAT_VERSION=`cat Version`
|
||||
TRUNK_REVISION=`svnversion | cut -d ":" -f1`
|
||||
CUR_DATE=`date +%Y%m%d`
|
||||
VERSION="${XCAT_VERSION}-${PKG_LOCATION}${CUR_DATE}"
|
||||
VERSION="$XCAT_VERSION$PKG_LOCATION-rev$TRUNK_REVISION-$CUR_DATE"
|
||||
|
||||
function makedeb {
|
||||
SRC_ROOT=$1
|
||||
@@ -48,7 +47,7 @@ function makedeb {
|
||||
do
|
||||
DIR=`echo ${DEBIAN_DIR} | sed -e 's/[/]debian$//'`
|
||||
cd ${DIR}
|
||||
dch -v $VERSION -b -c debian/changelog "$BUILD_STRING"
|
||||
dch -v $VERSION -c debian/changelog "$BUILD_STRING"
|
||||
dpkg-buildpackage
|
||||
cd -
|
||||
RC=$?
|
||||
@@ -61,19 +60,21 @@ function makedeb {
|
||||
#
|
||||
# Clean up
|
||||
#
|
||||
# Eliminate unnecessary directories and debian/files made by dpkg-buildpackage
|
||||
# Eliminate unnecessary directories and debian/files made by dpgk-buildpakcage
|
||||
|
||||
find $SRC_ROOT -maxdepth 3 -type d -name "xcat-*" | grep debian | xargs rm -rf
|
||||
find $SRC_ROOT -maxdepth 3 -type f -name "files" | grep debian | xargs rm -f
|
||||
}
|
||||
|
||||
# build all debian packages
|
||||
packages="xCAT-client xCAT-nbroot xCAT-nbroot2 perl-xCAT xCAT-server xCAT-UI xCAT xCATsn xCAT-test xCAT-IBMhpc xCAT-rmc"
|
||||
|
||||
for file in `echo $packages`
|
||||
do
|
||||
makedeb $file $PKG_LOCATION "$BUILD_STRING" $VERSION
|
||||
done
|
||||
makedeb xCAT-client $PKG_LOCATION "$BUILD_STRING" $VERSION
|
||||
makedeb xCAT-nbroot $PKG_LOCATION "$BUILD_STRING" $VERSION
|
||||
makedeb perl-xCAT $PKG_LOCATION "$BUILD_STRING" $VERSION
|
||||
makedeb xCAT-server $PKG_LOCATION "$BUILD_STRING" $VERSION
|
||||
makedeb xCAT-UI $PKG_LOCATION "$BUILD_STRING" $VERSION
|
||||
makedeb xCAT $PKG_LOCATION "$BUILD_STRING" $VERSION
|
||||
makedeb xCATsn $PKG_LOCATION "$BUILD_STRING" $VERSION
|
||||
makedeb xCAT-test $PKG_LOCATION "$BUILD_STRING" $VERSION
|
||||
|
||||
if [ -d debs ]; then
|
||||
rm -rf debs
|
||||
|
||||
+145
-307
@@ -1,377 +1,215 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
# Update GSA Ubuntu Repositories or create a local repository
|
||||
#
|
||||
# Author: Leonardo Tonetto (tonetto@linux.vnet.ibm.com)
|
||||
# Revisor: Arif Ali (aali@ocf.co.uk)
|
||||
#
|
||||
# After running this script, add the following line to
|
||||
# /etc/apt/sources.list for local repository
|
||||
# deb file://<core_repo_path>/xcat-core/ maverick main
|
||||
#
|
||||
# Getting Started:
|
||||
# - Check out the xcat-core svn repository (either the trunk or a branch) into
|
||||
# a dir called <rel>/src/xcat-core, where <rel> is the same as the release dir it will be
|
||||
# uploaded to in sourceforge (e.g. devel, or 2.3).
|
||||
# - You probably also want to put root's pub key from the build machine onto sourceforge for
|
||||
# the upload user listed below, so you don't have to keep entering pw's. You can do this
|
||||
# at https://sourceforge.net/account/ssh
|
||||
# - make sure reprepro is installed on the build machine
|
||||
# - Run this script from the local svn repository you just created. It will create the other directories that are needed.
|
||||
|
||||
# Usage: attr=value attr=value ... ./build-ubunturepo { -c | -d }
|
||||
# PROMOTE=1 - if the attribute "PROMOTE" is specified, means an official dot release. This does not
|
||||
# actually build xcat, just uploads the most recent snap build to https://sourceforge.net/projects/xcat/files/xcat/ .
|
||||
# If not specified, a snap build is assumed, which uploads to https://sourceforge.net/projects/xcat/files/yum/
|
||||
# or https://sourceforge.net/projects/xcat/files/aix/.
|
||||
# PREGA=1 - use this option with PROMOTE=1 on a branch that already has a released dot release, but this build is
|
||||
# a GA candidate build, not to be released yet. This will result in the tarball being uploaded to
|
||||
# https://sourceforge.net/projects/xcat/files/yum/ or https://sourceforge.net/projects/xcat/files/aix/
|
||||
# (but the tarball file name will be like a released tarball, not a snap build). When you are ready to
|
||||
# release this build, use PROMOTE=1 without PREGA
|
||||
# BUILDALL=1 - build all rpms, whether they changed or not. Should be used for snap builds that are in prep for a release.
|
||||
# UP=0 or UP=1 - override the default upload behavior
|
||||
#
|
||||
# For the dependency packages 1. please run the build-debs-all in xcat-dep svn first( there is usage detail in that script)
|
||||
# 2. run ./build-ubunturepo -d
|
||||
#
|
||||
############################
|
||||
printusage()
|
||||
{
|
||||
printf "Usage: %s {-c | -d} \n" $(basename $0) >&2
|
||||
echo " -c : Build the xcat core packages and create the repo"
|
||||
echo " -d : Create the xcat dep repo. Building the xcat dep packages can refer \"build-debs-all\" from svn"
|
||||
}
|
||||
# For the purpose of getting the distribution name
|
||||
. /etc/lsb-release
|
||||
|
||||
# Supported distributions
|
||||
dists="maverick natty oneiric precise"
|
||||
|
||||
a_flag= # automatic flag - only update if repo was updated
|
||||
c_flag= # xcat-core (trunk-delvel) path
|
||||
d_flag= # xcat-dep (trunk) path
|
||||
r_flag= #genesis base rpm package path
|
||||
u_flag= # gsa user-id
|
||||
p_flag= # gsa passwd
|
||||
local_flag= # build the repository localy
|
||||
|
||||
while getopts 'cdr:' OPTION
|
||||
while getopts 'c:d:u:p:l:a' OPTION
|
||||
do
|
||||
case $OPTION in
|
||||
c) c_flag=1
|
||||
xcat_core_path="$OPTARG"
|
||||
;;
|
||||
d) d_flag=1
|
||||
xcat_dep_path="$OPTARG"
|
||||
;;
|
||||
r) r_flag=1
|
||||
genesis_rpm_path="$OPTARG"
|
||||
;;
|
||||
?) printusage
|
||||
u) u_flag=1
|
||||
gsa_id="$OPTARG"
|
||||
;;
|
||||
p) p_flag=1
|
||||
gsa_passwd="$OPTARG"
|
||||
;;
|
||||
l) local_flag=1
|
||||
local_repo_path="$OPTARG"
|
||||
;;
|
||||
a) a_flag=1
|
||||
;;
|
||||
|
||||
?) printf "Usage: %s -c <core_trunk_path> [-d <dep_trunk_path>] { -l <local-repo_path> | [-u <gsa_id> -p <gsa_passwd>] } [-a]\n" $(basename $0) >&2
|
||||
echo "-a Automatic: update only if there's any update on repo"
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $(($OPTIND - 1))
|
||||
|
||||
if [ -z "$c_flag" -a -z "$d_flag" ];then
|
||||
printusage
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [ "$c_flag" -a "$d_flag" ];then
|
||||
printusage
|
||||
exit 2
|
||||
fi
|
||||
|
||||
uploader="bp-sawyers"
|
||||
# Find where this script is located to set some build variables
|
||||
old_pwd=`pwd`
|
||||
cd `dirname $0`
|
||||
curdir=`pwd`
|
||||
|
||||
#define the dep source code path, core build target path and dep build target path
|
||||
local_core_repo_path="$curdir/../../xcat-core"
|
||||
xcat_dep_path="$curdir/../../../xcat-dep/src/xcat-dep"
|
||||
local_dep_repo_path="$curdir/../../../xcat-dep/xcat-dep"
|
||||
|
||||
#define the url used for creating the source list file
|
||||
#define the upload dir used for uploading packages
|
||||
sf_repo_url="https://sourceforge.net/projects/xcat/files/ubuntu"
|
||||
sf_dir="/home/frs/project/x/xc/xcat"
|
||||
|
||||
#use flock to only one person build at the same time
|
||||
# Get a lock, so can not do 2 builds at once
|
||||
exec 8>/var/lock/xcatbld.lock
|
||||
if ! flock -n 8; then
|
||||
echo "Can't get lock /var/lock/xcatbld.lock. Someone else must be doing a build right now. Exiting...."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export HOME=/root
|
||||
|
||||
#sync the gpg key to the build machine local
|
||||
gsa_url=http://pokgsa.ibm.com/projects/x/xcat/build/linux
|
||||
mkdir -p $HOME/.gnupg
|
||||
for key_name in pubring.gpg secring.gpg trustdb.gpg; do
|
||||
if [ ! -f $HOME/.gnupg/$key_name ] || [ `wc -c $HOME/.gnupg/$key_name|cut -f 1 -d' '` == 0 ]; then
|
||||
rm -f $HOME/.gnupg/$key_name
|
||||
wget -P $HOME/.gnupg $gsa_url/keys/$key_name
|
||||
chmod 600 $HOME/.gnupg/$key_name
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$c_flag" ]
|
||||
if [ -z "$c_flag" ]
|
||||
then
|
||||
# strip the /src/xcat-core from the end of the dir to get the next dir up and use as the release
|
||||
if [ -z "$REL" ]; then
|
||||
t=${curdir%/src/xcat-core}
|
||||
REL=`basename $t`
|
||||
printf "Usage: %s -c <core_trunk_path> [-d <dep_trunk_path>] { -l <local-repo_path> | [-u <gsa_id> -p <gsa_passwd>] } [-a]\n" $(basename $0) >&2
|
||||
echo "-a Automatic: update only if there's any update on repo"
|
||||
exit 2
|
||||
fi
|
||||
if [ ! -d $xcat_core_path ]
|
||||
then
|
||||
printf "%s: No such directory\n" "$xcat_core_path" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [ "$d_flag" ]
|
||||
then
|
||||
if [ ! -d $xcat_dep_path ]
|
||||
then
|
||||
printf "%s: No such directory\n" "$xcat_dep_path" >&2
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$local_flag" ]
|
||||
then
|
||||
repo_xcat_core_path=$local_repo_path"/xcat-core"
|
||||
repo_xcat_dep_path=$local_repo_path"/xcat-dep"
|
||||
else
|
||||
if [ -z "$u_flag" ]
|
||||
then
|
||||
if [ "$p_flag" ]
|
||||
then
|
||||
printf "Usage: %s -c <core_trunk_path> [-d <dep_trunk_path>] { -l <local-repo_path> | [-u <gsa_id> -p <gsa_passwd>] } [-a]\n" $(basename $0) >&2
|
||||
echo "-a Automatic: update only if there's any update on repo"
|
||||
exit 2
|
||||
fi
|
||||
echo -n "GSA id: "
|
||||
read gsa_id
|
||||
echo -n "GSA password: "
|
||||
stty -echo; read gsa_passwd; stty echo;
|
||||
echo ""; echo "";
|
||||
fi
|
||||
|
||||
ver=`cat Version`
|
||||
if [ "$PROMOTE" != 1 ]; then
|
||||
#get the version
|
||||
echo "svn --quiet update Version"
|
||||
svn --quiet up Version
|
||||
ver=`cat Version`
|
||||
short_ver=`cat Version|cut -d. -f 1,2`
|
||||
short_short_ver=`cat Version|cut -d. -f 1`
|
||||
repo_xcat_core_path="`pwd`/gsa-repo_temp/xcat-core"
|
||||
repo_xcat_dep_path="`pwd`/gsa-repo_temp/xcat-dep"
|
||||
fi
|
||||
|
||||
#TODO: define the core path and tarball name
|
||||
tarball_name="core-debs-snap.tar.bz2"
|
||||
|
||||
#update the code from svn
|
||||
svn_up_log="../coresvnup"
|
||||
echo "svn update > $svn_up_log"
|
||||
svn update > $svn_up_log
|
||||
|
||||
#makesure the code change status
|
||||
code_change=0
|
||||
if ! grep -q 'At revision' $svn_up_log;then
|
||||
code_change=1
|
||||
fi
|
||||
|
||||
if [ $code_change == 0 -a "$UP" != 1 -a "$BUILDALL" != 1 ]; then
|
||||
echo "Nothing new detected"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "###############################"
|
||||
echo "# Building xcat-core packages #"
|
||||
echo "###############################"
|
||||
|
||||
#the package type: local | snap | alpha
|
||||
#the build introduce stirng
|
||||
pkg_type="snap"
|
||||
build_string="Snap_Build"
|
||||
cur_date=`date +%Y%m%d`
|
||||
pkg_version="${short_ver}-${pkg_type}${cur_date}"
|
||||
|
||||
if [ ! -d ../../debs ];then
|
||||
mkdir -p "../../debs"
|
||||
fi
|
||||
packages="xCAT-client xCAT-genesis-scripts perl-xCAT xCAT-server xCAT-UI xCAT xCATsn xCAT-test xCAT-OpenStack"
|
||||
|
||||
for file in `echo $packages`
|
||||
do
|
||||
file_low=`echo $file | tr '[A-Z]' '[a-z]'`
|
||||
if grep -q $file $svn_up_log || [ "$BUILDALL" == 1 -o "$file" = "perl-xCAT" ]; then
|
||||
rm -f ../../debs/${file_low}_*.deb
|
||||
#only for genesis package
|
||||
rm -f ../../debs/${file_low}-amd64_*.deb
|
||||
cd $file
|
||||
dch -v $pkg_version -b -c debian/changelog $build_string
|
||||
dpkg-buildpackage -uc -us
|
||||
rc=$?
|
||||
if [ $rc -gt 0 ]; then
|
||||
echo "Error: $file build package failed exit code $rc"
|
||||
fi
|
||||
cd -
|
||||
find $file -maxdepth 3 -type d -name "${file_low}*" | grep debian | xargs rm -rf
|
||||
find $file -maxdepth 3 -type f -name "files" | grep debian | xargs rm -rf
|
||||
mv ${file_low}* ../../debs/
|
||||
fi
|
||||
done
|
||||
|
||||
find ../../debs/* ! -name *.deb | xargs rm -f
|
||||
fi
|
||||
|
||||
if [ "$PROMOTE" = 1 ]; then
|
||||
upload_dir="xcat-core"
|
||||
tar_name="xcat-core-$ver.tar.bz2"
|
||||
if [ "$a_flag" ]
|
||||
then
|
||||
touch svcupdate.trace
|
||||
SVCUP='svcupdate.trace'
|
||||
svn update $xcat_core_path 1> $SVCUP 2>&1
|
||||
if ! grep 'Tree is up to date' $SVCUP
|
||||
then
|
||||
update_core=1
|
||||
else
|
||||
upload_dir="core-snap"
|
||||
tar_name="core-debs-snap.tar.bz2"
|
||||
update_core=
|
||||
fi
|
||||
rm -f $SVCUP
|
||||
else
|
||||
update_core=1
|
||||
fi
|
||||
if [ "$update_core" ]
|
||||
then
|
||||
echo "###############################"
|
||||
echo "# Building xcat-core packages #"
|
||||
echo "###############################"
|
||||
|
||||
CMD_PATH=`pwd`
|
||||
cd $xcat_core_path
|
||||
./build-debs-all "snap" "Nightly_Builds"
|
||||
|
||||
echo "#################################"
|
||||
echo "# Creating xcat-core repository #"
|
||||
echo "#################################"
|
||||
|
||||
#clean the repo directory
|
||||
if [ -e $local_core_repo_path ]; then
|
||||
rm -rf $local_core_repo_path
|
||||
if [ -d $repo_xcat_core_path ]; then
|
||||
rm -rdf $repo_xcat_core_path
|
||||
fi
|
||||
mkdir -p $local_core_repo_path
|
||||
cd $local_core_repo_path
|
||||
mkdir conf
|
||||
mkdir -p $repo_xcat_core_path/conf
|
||||
|
||||
for dist in $dists; do
|
||||
cat << __EOF__ >> conf/distributions
|
||||
find . -iname '*.deb' -exec mv {} $repo_xcat_core_path \;
|
||||
|
||||
rm -rdf debs/
|
||||
cd $CMD_PATH
|
||||
|
||||
cat << __EOF__ > $repo_xcat_core_path/conf/distributions
|
||||
Origin: xCAT internal repository
|
||||
Label: xcat-core bazaar repository
|
||||
Codename: $dist
|
||||
Architectures: amd64
|
||||
Codename: maverick
|
||||
Architectures: i386 amd64
|
||||
Components: main
|
||||
Description: Repository automatically genereted conf
|
||||
SignWith: yes
|
||||
|
||||
__EOF__
|
||||
done
|
||||
|
||||
cat << __EOF__ > conf/options
|
||||
cat << __EOF__ > $repo_xcat_core_path/conf/options
|
||||
verbose
|
||||
ask-passphrase
|
||||
basedir .
|
||||
__EOF__
|
||||
|
||||
#import the deb packages into the repo
|
||||
for dist in $dists; do
|
||||
for file in `ls ../debs/*.deb`; do
|
||||
reprepro -b ./ includedeb $dist $file;
|
||||
done
|
||||
for file in `ls $repo_xcat_core_path/*.deb`; do
|
||||
reprepro -b $repo_xcat_core_path includedeb maverick $file;
|
||||
done
|
||||
|
||||
#create the mklocalrepo script
|
||||
cat << __EOF__ > mklocalrepo.sh
|
||||
. /etc/lsb-release
|
||||
cd `dirname $0`
|
||||
echo deb file://"`pwd`" $DISTRIB_CODENAME main > /etc/apt/sources.list.d/xcat-core.list
|
||||
__EOF__
|
||||
mv $xcat_core_path/latest_version $repo_xcat_core_path/xcat-core_latest-build
|
||||
|
||||
chmod 775 mklocalrepo.sh
|
||||
if [ -z "$local_flag" ]
|
||||
then
|
||||
echo "###############################"
|
||||
echo "# Updating GSA xcat-core repo #"
|
||||
echo "###############################"
|
||||
lftp -e "mirror -R --delete-first $repo_xcat_core_path /projects/i/ipl-xcat/ubuntu/; exit;" -u $gsa_id,$gsa_passwd -p 22 sftp://ausgsa.ibm.com
|
||||
fi ### if [ -z "$local_flag" ]
|
||||
fi ### if [ "$a_flag" ]
|
||||
|
||||
#create the xcat-core.list file
|
||||
#echo "deb ${sf_repo_url}/${REL}/${upload_dir}/ precise main" > xcat-core.list
|
||||
|
||||
cd ../
|
||||
if ! grep xcat /etc/group ; then
|
||||
groupadd xcat
|
||||
fi
|
||||
|
||||
chgrp -R root xcat-core
|
||||
chmod -R g+w xcat-core
|
||||
|
||||
#build the tar ball
|
||||
tar -hjcf $tar_name xcat-core
|
||||
chgrp root $tar_name
|
||||
chmod g+w $tar_name
|
||||
|
||||
if [ ! -e core-snap ]; then
|
||||
ln -s xcat-core core-snap
|
||||
fi
|
||||
|
||||
# Decide whether to upload or not
|
||||
if [ -n "$UP" ] && [ "$UP" == 0 ]; then
|
||||
echo "No need to upload"
|
||||
cd $old_pwd
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#upload the deb packages
|
||||
if [ "$REL" = "devel" -o "$PREGA" != 1 ]; then
|
||||
i=0
|
||||
echo "Uploading RPMs from $upload_dir to ${sf_dir}/ubuntu/${REL}/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -urLv --delete $upload_dir ${uploader},xcat@web.sourceforge.net:${sf_dir}/ubuntu/${REL}/
|
||||
do : ; done
|
||||
fi
|
||||
|
||||
#upload the tar ball
|
||||
#for the GA build, upload to https://sourceforge.net/projects/xcat/files/xcat/<version>.x_Ubuntu/
|
||||
#for other scenario, upload to https://sourceforge.net/projects/xcat/files/ubuntu/<version>
|
||||
if [ "$PROMOTE" = 1 -a "$REL" != "devel" -a "$PREGA" != 1 ]; then
|
||||
i=0
|
||||
echo "Uploading $tar_name to ${sf_dir}/xcat/${REL}.x_Ubuntu/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -v $tar_name ${uploader},xcat@web.sourceforge.net:${sf_dir}/xcat/${REL}.x_Ubuntu/
|
||||
do : ; done
|
||||
if [ "$a_flag" -a "$d_flag" ]
|
||||
then
|
||||
touch svcupdate.trace
|
||||
SVCUP='svcupdate.trace'
|
||||
svn update $xcat_dep_path 1> $SVCUP 2>&1
|
||||
if ! grep 'Tree is up to date' $SVCUP
|
||||
then
|
||||
update_dep=1
|
||||
else
|
||||
i=0
|
||||
echo "Uploading $tar_name to ${sf_dir}/ubuntu/${REL}/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -v $tar_name ${uploader},xcat@web.sourceforge.net:${sf_dir}/ubuntu/${REL}/
|
||||
do : ; done
|
||||
update_dep=
|
||||
fi
|
||||
|
||||
cd $old_pwd
|
||||
rm -f $SVCUP
|
||||
else
|
||||
update_dep=1
|
||||
fi
|
||||
|
||||
if [ "$d_flag" ]
|
||||
if [ "$d_flag" -a "$update_dep" ]
|
||||
then
|
||||
echo "################################"
|
||||
echo "# Creating xcat-dep repository #"
|
||||
echo "################################"
|
||||
|
||||
#clean all old files
|
||||
if [ -e $local_dep_repo_path ];then
|
||||
rm -rf $local_dep_repo_path
|
||||
fi
|
||||
mkdir -p $local_dep_repo_path
|
||||
cd $local_dep_repo_path
|
||||
mkdir conf
|
||||
|
||||
#create the conf/distributions file
|
||||
for dist in $dists; do
|
||||
cat << __EOF__ >> conf/distributions
|
||||
rm -rdf $repo_xcat_dep_path
|
||||
mkdir -p $repo_xcat_dep_path/conf
|
||||
find $xcat_dep_path -iname '*.deb' -exec cp {} $repo_xcat_dep_path \;
|
||||
cat << __EOF__ > $repo_xcat_dep_path/conf/distributions
|
||||
Origin: xCAT internal repository
|
||||
Label: xcat-dep bazaar repository
|
||||
Codename: $dist
|
||||
Architectures: amd64
|
||||
Codename: maverick
|
||||
Architectures: i386 amd64
|
||||
Components: main
|
||||
Description: Repository automatically genereted conf
|
||||
SignWith: yes
|
||||
|
||||
__EOF__
|
||||
done
|
||||
|
||||
cat << __EOF__ > conf/options
|
||||
cat << __EOF__ > $repo_xcat_dep_path/conf/options
|
||||
verbose
|
||||
ask-passphrase
|
||||
basedir .
|
||||
__EOF__
|
||||
|
||||
for dist in $dists; do
|
||||
for file in `ls ../debs/*.deb`; do
|
||||
reprepro -b ./ includedeb $dist $file;
|
||||
done
|
||||
for file in `ls $repo_xcat_dep_path/*.deb`; do
|
||||
reprepro -b $repo_xcat_dep_path includedeb maverick $file;
|
||||
done
|
||||
|
||||
cat << '__EOF__' > mklocalrepo.sh
|
||||
. /etc/lsb-release
|
||||
cd `dirname $0`
|
||||
echo deb file://"`pwd`" $DISTRIB_CODENAME main > /etc/apt/sources.list.d/xcat-dep.list
|
||||
__EOF__
|
||||
if [ -z "$local_flag" ]
|
||||
then
|
||||
echo "##############################"
|
||||
echo "# Updating GSA xcat-dep repo #"
|
||||
echo "##############################"
|
||||
lftp -e "mirror -R --delete-first $repo_xcat_dep_path /projects/i/ipl-xcat/ubuntu/; exit;" -u $gsa_id,$gsa_passwd -p 22 sftp://ausgsa.ibm.com
|
||||
fi ### if [ -z "$local_flag" ]
|
||||
fi ### if [ "$d_flag" -a "$a_flag"]
|
||||
|
||||
chmod 775 mklocalrepo.sh
|
||||
|
||||
#echo ""deb ${sf_repo_url}/xcat-dep/ precise main"" > xcat-dep.list
|
||||
|
||||
cd ..
|
||||
if ! grep xcat /etc/group ; then
|
||||
groupadd xcat
|
||||
fi
|
||||
|
||||
chgrp -R root xcat-dep
|
||||
chmod -R g+w xcat-dep
|
||||
|
||||
#create the tar ball
|
||||
dep_tar_name=xcat-dep-ubuntu.tar.bz
|
||||
tar -hjcf $dep_tar_name xcat-dep
|
||||
chgrp root $dep_tar_name
|
||||
chmod g+w $dep_tar_name
|
||||
|
||||
if [ -n "$UP" ] && [ "$UP" == 0 ];then
|
||||
echo "No need to upload the dep packages"
|
||||
cd $old_pwd
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#upload the dep packages
|
||||
i=0
|
||||
echo "Uploading debs from xcat-dep to ${sf_dir}/ubuntu/xcat-dep/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -urLv --delete xcat-dep ${uploader},xcat@web.sourceforge.net:${sf_dir}/ubuntu/
|
||||
do : ; done
|
||||
#upload the tarball
|
||||
cd $old_pwd
|
||||
if [ -z "$local_flag" ] # delete the temp repo after upload is done
|
||||
then
|
||||
rm -rdf ./gsa-repo_temp
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
+96
-190
@@ -19,20 +19,14 @@
|
||||
# directories that are needed.
|
||||
|
||||
# Usage: buildcore.sh [attr=value attr=value ...]
|
||||
# Before running buildcore.sh, you must change the local git repo to the branch you want built, using: git checkout <branch>
|
||||
# PROMOTE=1 - if the attribute "PROMOTE" is specified, means an official dot release. This does not
|
||||
# actually build xcat, just uploads the most recent snap build to https://sourceforge.net/projects/xcat/files/xcat/ .
|
||||
# If not specified, a snap build is assumed, which uploads to https://sourceforge.net/projects/xcat/files/yum/
|
||||
# or https://sourceforge.net/projects/xcat/files/aix/.
|
||||
# PREGA=1 - use this option with PROMOTE=1 on a branch that already has a released dot release, but this build is
|
||||
# a GA candidate build, not to be released yet. This will result in the tarball being uploaded to
|
||||
# https://sourceforge.net/projects/xcat/files/yum/ or https://sourceforge.net/projects/xcat/files/aix/
|
||||
# (but the tarball file name will be like a released tarball, not a snap build). When you are ready to
|
||||
# release this build, use PROMOTE=1 without PREGA
|
||||
# PROMOTE=1 - if the attribute "PROMOTE" is specified, means an official dot release.
|
||||
# Otherwise, and snap build is assumed.
|
||||
# PREGA=1 - means this is a branch that has not been released yet, so during the promote, copy the
|
||||
# xcat-core tarball to the SF web site instead of the FRS area.
|
||||
# BUILDALL=1 - build all rpms, whether they changed or not. Should be used for snap builds that are in prep for a release.
|
||||
# UP=0 or UP=1 - override the default upload behavior
|
||||
# SVNUP=<filename> - control which rpms get built by specifying a coresvnup file
|
||||
# GITUP=<filename> - control which rpms get built by specifying a coregitup file
|
||||
# FRSYUM=0 - put the yum repo and snap builds in the old project web area instead of the FRS area.
|
||||
# EMBED=<embedded-environment> - the environment for which a minimal version of xcat should be built, e.g. zvm or flex
|
||||
# VERBOSE=1 - to see lots of verbose output
|
||||
|
||||
@@ -40,17 +34,6 @@
|
||||
UPLOADUSER=bp-sawyers
|
||||
FRS=/home/frs/project/x/xc/xcat
|
||||
|
||||
# These are the rpms that should be built for each kind of xcat build
|
||||
ALLBUILD="perl-xCAT xCAT-client xCAT-server xCAT-IBMhpc xCAT-rmc xCAT-UI xCAT-test xCAT-buildkit xCAT xCATsn xCAT-genesis-scripts xCAT-OpenStack"
|
||||
ZVMBUILD="perl-xCAT xCAT-server xCAT-UI"
|
||||
ZVMLINK="xCAT-client xCAT xCATsn"
|
||||
PCMBUILD="xCAT"
|
||||
PCMLINK="perl-xCAT xCAT-client xCAT-server xCAT-buildkit xCAT-genesis-scripts-x86_64"
|
||||
# Note: for FSM, the FlexCAT rpm is built separately from gsa/git
|
||||
FSMBUILD="perl-xCAT xCAT-client xCAT-server"
|
||||
FSMLINK=""
|
||||
# If you add more embed cases, also change the if [ -n "$EMBED" ]... below
|
||||
|
||||
# Process cmd line variable assignments, assigning each attr=val pair to a variable of same name
|
||||
for i in $*; do
|
||||
# upper case the variable name
|
||||
@@ -85,79 +68,51 @@ if [ "$OSNAME" != "AIX" ]; then
|
||||
export HOME=/root # This is so rpm and gpg will know home, even in sudo
|
||||
fi
|
||||
|
||||
# for the git case, query the current branch and set REL (changing master to devel if necessary)
|
||||
function setbranch {
|
||||
#git checkout $BRANCH
|
||||
#REL=`git rev-parse --abbrev-ref HEAD`
|
||||
REL=`git name-rev --name-only HEAD`
|
||||
if [ "$REL" = "master" ]; then
|
||||
REL="devel"
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "$REL" = "xcat-core" ]; then # using git
|
||||
GIT=1
|
||||
setbranch # this changes the REL variable
|
||||
# this is needed only when we are transitioning the yum over to frs
|
||||
if [ "$FRSYUM" != 0 ]; then
|
||||
YUMDIR=$FRS
|
||||
YUMREPOURL="https://sourceforge.net/projects/xcat/files/yum"
|
||||
else
|
||||
YUMDIR=htdocs
|
||||
YUMREPOURL="http://xcat.sourceforge.net/yum"
|
||||
fi
|
||||
|
||||
YUMDIR=$FRS
|
||||
YUMREPOURL="https://sourceforge.net/projects/xcat/files/yum"
|
||||
|
||||
# Set variables based on which type of build we are doing
|
||||
if [ -n "$EMBED" ]; then
|
||||
EMBEDDIR="/$EMBED"
|
||||
if [ "$EMBED" = "zvm" ]; then
|
||||
EMBEDBUILD=$ZVMBUILD
|
||||
EMBEDLINK=$ZVMLINK
|
||||
elif [ "$EMBED" = "pcm" ]; then
|
||||
EMBEDBUILD=$PCMBUILD
|
||||
EMBEDLINK=$PCMLINK
|
||||
elif [ "$EMBED" = "fsm" ]; then
|
||||
EMBEDBUILD=$FSMBUILD
|
||||
EMBEDLINK=$FSMLINK
|
||||
if [ -n "$EMBED" ]; then EMBEDDIR="/$EMBED"
|
||||
else EMBEDDIR=""; fi
|
||||
XCATCORE="xcat-core" # core-snap is a sym link to xcat-core
|
||||
echo "svn --quiet up Version"
|
||||
svn --quiet up Version
|
||||
VER=`cat Version`
|
||||
SHORTVER=`cat Version|cut -d. -f 1,2`
|
||||
SHORTSHORTVER=`cat Version|cut -d. -f 1`
|
||||
if [ "$PROMOTE" = 1 ]; then
|
||||
CORE="xcat-core"
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
TARNAME=core-aix-$VER.tar.gz
|
||||
else
|
||||
echo "Error: EMBED setting $EMBED not recognized."
|
||||
exit 2
|
||||
TARNAME=xcat-core-$VER.tar.bz2
|
||||
fi
|
||||
else
|
||||
EMBEDDIR=""
|
||||
EMBEDBUILD=$ALLBUILD
|
||||
EMBEDLINK=""
|
||||
fi
|
||||
|
||||
XCATCORE="xcat-core" # core-snap is a sym link to xcat-core
|
||||
|
||||
if [ "$GIT" = "1" ]; then # using git - need to include REL in the path where we put the built rpms
|
||||
DESTDIR=../../$REL$EMBEDDIR/$XCATCORE
|
||||
else
|
||||
DESTDIR=../..$EMBEDDIR/$XCATCORE
|
||||
CORE="core-snap"
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
TARNAME=core-aix-snap.tar.gz
|
||||
else
|
||||
TARNAME=core-rpms-snap.tar.bz2
|
||||
fi
|
||||
fi
|
||||
DESTDIR=../..$EMBEDDIR/$XCATCORE
|
||||
SRCD=core-snap-srpms
|
||||
|
||||
# currently aix builds ppc rpms, but someday it should build noarch
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
NOARCH=ppc
|
||||
SYSGRP=system
|
||||
else
|
||||
NOARCH=noarch
|
||||
SYSGRP=root
|
||||
fi
|
||||
|
||||
function setversionvars {
|
||||
VER=`cat Version`
|
||||
SHORTVER=`cat Version|cut -d. -f 1,2`
|
||||
SHORTSHORTVER=`cat Version|cut -d. -f 1`
|
||||
}
|
||||
|
||||
|
||||
if [ "$PROMOTE" != 1 ]; then # very long if statement to not do builds if we are promoting
|
||||
# we are doing a snap build
|
||||
CORE="core-snap"
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
TARNAME=core-aix-snap.tar.gz
|
||||
else
|
||||
TARNAME=core-rpms-snap.tar.bz2
|
||||
fi
|
||||
mkdir -p $DESTDIR
|
||||
SRCDIR=$DESTDIR/../$SRCD
|
||||
mkdir -p $SRCDIR
|
||||
@@ -178,39 +133,18 @@ else
|
||||
#echo "source=$source"
|
||||
fi
|
||||
|
||||
# If they have not given us a premade update file, do an svn update or git pull and capture the results
|
||||
# If they have not given us a premade update file, do an svn update and capture the results
|
||||
if [ -z "$SVNUP" ]; then
|
||||
SVNUP=../coresvnup
|
||||
echo "svn up > $SVNUP"
|
||||
svn up > $SVNUP
|
||||
fi
|
||||
SOMETHINGCHANGED=0
|
||||
if [ "$GIT" = "1" ]; then # using git
|
||||
if [ -z "$GITUP" ]; then
|
||||
GITUP=../coregitup
|
||||
echo "git pull > $GITUP"
|
||||
git pull > $GITUP
|
||||
if [[ $? != 0 ]]; then
|
||||
# do not continue so we do not build with old files
|
||||
echo "The 'git pull' command failed. Exiting the build."
|
||||
exit 3
|
||||
fi
|
||||
fi
|
||||
if ! $GREP 'Already up-to-date' $GITUP; then
|
||||
SOMETHINGCHANGED=1
|
||||
fi
|
||||
else # using svn
|
||||
GIT=0
|
||||
if [ -z "$SVNUP" ]; then
|
||||
SVNUP=../coresvnup
|
||||
echo "svn up > $SVNUP"
|
||||
svn up > $SVNUP
|
||||
fi
|
||||
if ! $GREP 'At revision' $SVNUP; then
|
||||
SOMETHINGCHANGED=1
|
||||
fi
|
||||
# copy the SVNUP variable to GITUP so the rest of the script doesnt have to worry whether we did svn or git
|
||||
GITUP=$SVNUP
|
||||
if ! $GREP 'At revision' $SVNUP; then
|
||||
SOMETHINGCHANGED=1
|
||||
fi
|
||||
|
||||
setversionvars
|
||||
|
||||
# Function for making the noarch rpms
|
||||
# Process for making most of the rpms
|
||||
function maker {
|
||||
rpmname="$1"
|
||||
./makerpm $rpmname "$EMBED"
|
||||
@@ -225,11 +159,9 @@ function maker {
|
||||
}
|
||||
|
||||
# If anything has changed, we should always rebuild perl-xCAT
|
||||
if [ $SOMETHINGCHANGED == 1 -o "$BUILDALL" == 1 ]; then # Use to be: $GREP perl-xCAT $GITUP; then
|
||||
if [[ " $EMBEDBUILD " = *\ perl-xCAT\ * ]]; then
|
||||
UPLOAD=1
|
||||
maker perl-xCAT
|
||||
fi
|
||||
if [ $SOMETHINGCHANGED == 1 -o "$BUILDALL" == 1 ]; then # Use to be: $GREP perl-xCAT $SVNUP; then
|
||||
UPLOAD=1
|
||||
maker perl-xCAT
|
||||
fi
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
# For the 1st one we overwrite, not append
|
||||
@@ -237,12 +169,10 @@ if [ "$OSNAME" = "AIX" ]; then
|
||||
fi
|
||||
|
||||
# Build the rest of the noarch rpms
|
||||
for rpmname in xCAT-client xCAT-server xCAT-IBMhpc xCAT-rmc xCAT-UI xCAT-test xCAT-buildkit; do
|
||||
#if [ "$EMBED" = "zvm" -a "$rpmname" != "xCAT-server" -a "$rpmname" != "xCAT-UI" ]; then continue; fi # for zvm embedded env only need to build server and UI
|
||||
if [[ " $EMBEDBUILD " != *\ $rpmname\ * ]]; then continue; fi
|
||||
if [ "$OSNAME" = "AIX" -a "$rpmname" = "xCAT-buildkit" ]; then continue; fi # do not build xCAT-buildkit on aix
|
||||
if $GREP $rpmname $GITUP || [ "$BUILDALL" == 1 ]; then
|
||||
for rpmname in xCAT-client xCAT-server xCAT-IBMhpc xCAT-rmc xCAT-UI xCAT-test; do
|
||||
if $GREP $rpmname $SVNUP || [ "$BUILDALL" == 1 ]; then
|
||||
UPLOAD=1
|
||||
if [ "$EMBED" = "zvm" -a "$rpmname" != "xCAT-server" -a "$rpmname" != "xCAT-UI" ]; then continue; fi # for embedded envs only need to build server special
|
||||
maker $rpmname
|
||||
fi
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
@@ -252,40 +182,35 @@ for rpmname in xCAT-client xCAT-server xCAT-IBMhpc xCAT-rmc xCAT-UI xCAT-test xC
|
||||
fi
|
||||
done
|
||||
|
||||
# Build xCAT-genesis-scripts for xcat-core. xCAT-genesis-base gets built by hand and put in xcat-dep.
|
||||
# The mknb cmd combines them at install time.
|
||||
if [ "$OSNAME" != "AIX" ]; then
|
||||
if [[ " $EMBEDBUILD " = *\ xCAT-genesis-scripts\ * ]]; then
|
||||
if $GREP xCAT-genesis-scripts $GITUP || [ "$BUILDALL" == 1 ]; then
|
||||
UPLOAD=1
|
||||
ORIGFAILEDRPMS="$FAILEDRPMS"
|
||||
./makerpm xCAT-genesis-scripts x86_64 "$EMBED"
|
||||
if [ $? -ne 0 ]; then FAILEDRPMS="$FAILEDRPMS xCAT-genesis-scripts-x86_64"; fi
|
||||
if [ "$FAILEDRPMS" = "$ORIGFAILEDRPMS" ]; then # all succeeded
|
||||
rm -f $DESTDIR/xCAT-genesis-scripts*rpm
|
||||
rm -f $SRCDIR/xCAT-genesis-scripts*rpm
|
||||
mv $source/RPMS/noarch/xCAT-genesis-scripts-*rpm $DESTDIR
|
||||
mv $source/SRPMS/xCAT-genesis-scripts-*rpm $SRCDIR
|
||||
fi
|
||||
if [ "$OSNAME" != "AIX" -a "$EMBED" != "zvm" ]; then
|
||||
if grep -v nbroot2 $SVNUP|$GREP xCAT-nbroot || [ "$BUILDALL" == 1 ]; then
|
||||
UPLOAD=1
|
||||
ORIGFAILEDRPMS="$FAILEDRPMS"
|
||||
for arch in x86_64 x86 ppc64; do
|
||||
./makerpm xCAT-nbroot-core $arch
|
||||
if [ $? -ne 0 ]; then FAILEDRPMS="$FAILEDRPMS xCAT-nbroot-core-$arch"; fi
|
||||
done
|
||||
if [ "$FAILEDRPMS" = "$ORIGFAILEDRPMS" ]; then # all succeeded
|
||||
rm -f $DESTDIR/xCAT-nbroot-core*rpm
|
||||
rm -f $SRCDIR/xCAT-nbroot-core*rpm
|
||||
mv $source/RPMS/noarch/xCAT-nbroot-core-*rpm $DESTDIR
|
||||
mv $source/SRPMS/xCAT-nbroot-core-*rpm $SRCDIR
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Build the xCAT and xCATsn rpms for all platforms
|
||||
for rpmname in xCAT xCATsn xCAT-OpenStack; do
|
||||
#if [ "$EMBED" = "zvm" ]; then break; fi
|
||||
if [[ " $EMBEDBUILD " != *\ $rpmname\ * ]]; then continue; fi
|
||||
if [ $SOMETHINGCHANGED == 1 -o "$BUILDALL" == 1 ]; then # used to be: if $GREP -E "^[UAD] +$rpmname/" $GITUP; then
|
||||
for rpmname in xCAT xCATsn; do
|
||||
if [ "$EMBED" = "zvm" ]; then break; fi
|
||||
if [ $SOMETHINGCHANGED == 1 -o "$BUILDALL" == 1 ]; then # used to be: if $GREP -E "^[UAD] +$rpmname/" $SVNUP; then
|
||||
UPLOAD=1
|
||||
ORIGFAILEDRPMS="$FAILEDRPMS"
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
if [ "$rpmname" = "xCAT-OpenStack" ]; then continue; fi # do not bld openstack on aix
|
||||
./makerpm $rpmname "$EMBED"
|
||||
./makerpm $rpmname
|
||||
if [ $? -ne 0 ]; then FAILEDRPMS="$FAILEDRPMS $rpmname"; fi
|
||||
else
|
||||
for arch in x86_64 ppc64 s390x; do
|
||||
if [ "$rpmname" = "xCAT-OpenStack" -a "$arch" != "x86_64" ]; then continue; fi # only bld openstack for x86_64 for now
|
||||
./makerpm $rpmname $arch "$EMBED"
|
||||
for arch in x86_64 i386 ppc64 s390x; do
|
||||
./makerpm $rpmname $arch
|
||||
if [ $? -ne 0 ]; then FAILEDRPMS="$FAILEDRPMS $rpmname-$arch"; fi
|
||||
done
|
||||
fi
|
||||
@@ -297,30 +222,24 @@ for rpmname in xCAT xCATsn xCAT-OpenStack; do
|
||||
fi
|
||||
fi
|
||||
done
|
||||
# no longer put in xCAT-rmc
|
||||
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
echo "rpm -Uvh xCAT-$SHORTSHORTVER*rpm" >> $DESTDIR/instxcat
|
||||
echo "rpm -Uvh xCAT-rmc-$SHORTSHORTVER*rpm" >> $DESTDIR/instxcat
|
||||
fi
|
||||
|
||||
# Make sym links in the embed subdirs for the rpms we do not have to build special
|
||||
if [ -n "$EMBED" -a -n "$EMBEDLINK" ]; then
|
||||
cd $DESTDIR
|
||||
cd $DESTDIR
|
||||
if [ "$EMBED" = "zvm" ]; then
|
||||
maindir="../../$XCATCORE"
|
||||
for rpmname in $EMBEDLINK; do
|
||||
if [ "$rpmname" = "xCAT" -o "$rpmname" = "xCATsn" ]; then
|
||||
if [ "$EMBED" = "zvm" ]; then
|
||||
echo "Creating link for $rpmname-$SHORTSHORTVER"'*.s390x.rpm'
|
||||
rm -f $rpmname-$SHORTSHORTVER*rpm
|
||||
ln -s $maindir/$rpmname-$SHORTSHORTVER*.s390x.rpm .
|
||||
fi
|
||||
else
|
||||
echo "Creating link for $rpmname-$SHORTSHORTVER"'*rpm'
|
||||
rm -f $rpmname-$SHORTSHORTVER*rpm
|
||||
ln -s $maindir/$rpmname-$SHORTSHORTVER*rpm .
|
||||
fi
|
||||
done
|
||||
cd - >/dev/null
|
||||
rm -f xCAT-client-$SHORTSHORTVER*rpm
|
||||
ln -s $maindir/xCAT-client-$SHORTSHORTVER*rpm .
|
||||
rm -f xCAT-$SHORTSHORTVER*rpm
|
||||
ln -s $maindir/xCAT-$SHORTSHORTVER*.s390x.rpm .
|
||||
rm -f xCATsn-$SHORTSHORTVER*rpm
|
||||
ln -s $maindir/xCATsn-$SHORTSHORTVER*.s390x.rpm .
|
||||
fi
|
||||
cd - >/dev/null
|
||||
|
||||
|
||||
# Decide if anything was built or not
|
||||
@@ -355,10 +274,10 @@ if [ "$OSNAME" != "AIX" ]; then
|
||||
echo '%_gpg_name Jarrod Johnson' >> $MACROS
|
||||
fi
|
||||
echo "Signing RPMs..."
|
||||
build-utils/rpmsign.exp `find $DESTDIR -type f -name '*.rpm'` | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)'
|
||||
build-utils/rpmsign.exp $SRCDIR/*rpm | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)'
|
||||
createrepo --checksum sha $DESTDIR # specifying checksum so the repo will work on rhel5
|
||||
createrepo --checksum sha $SRCDIR
|
||||
build-utils/rpmsign.exp `find $DESTDIR -type f -name '*.rpm'` | grep -v -E '(was already signed|rpm --quiet --resign|WARNING: standard input reopened)'
|
||||
build-utils/rpmsign.exp $SRCDIR/*rpm | grep -v -E '(was already signed|rpm --quiet --resign|WARNING: standard input reopened)'
|
||||
createrepo $DESTDIR
|
||||
createrepo $SRCDIR
|
||||
rm -f $SRCDIR/repodata/repomd.xml.asc
|
||||
rm -f $DESTDIR/repodata/repomd.xml.asc
|
||||
gpg -a --detach-sign $DESTDIR/repodata/repomd.xml
|
||||
@@ -371,26 +290,23 @@ if [ "$OSNAME" != "AIX" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# set group and permissions correctly on the built rpms
|
||||
# make everything have a group of xcat, so anyone can manage them once they get on SF
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
if ! lsgroup xcat >/dev/null 2>&1; then
|
||||
mkgroup xcat
|
||||
fi
|
||||
chmod +x $DESTDIR/instxcat
|
||||
fi
|
||||
chgrp -R $SYSGRP $DESTDIR
|
||||
chmod -R g+w $DESTDIR
|
||||
chgrp -R $SYSGRP $SRCDIR
|
||||
chmod -R g+w $SRCDIR
|
||||
|
||||
else # end of very long if-not-promote
|
||||
# we are only promoting (not building)
|
||||
setversionvars
|
||||
setbranch
|
||||
CORE="xcat-core"
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
TARNAME=core-aix-$VER.tar.gz
|
||||
else
|
||||
TARNAME=xcat-core-$VER.tar.bz2
|
||||
else # linux
|
||||
if ! $GREP xcat /etc/group; then
|
||||
groupadd xcat
|
||||
fi
|
||||
fi
|
||||
chgrp -R xcat $DESTDIR
|
||||
chmod -R g+w $DESTDIR
|
||||
chgrp -R xcat $SRCDIR
|
||||
chmod -R g+w $SRCDIR
|
||||
|
||||
fi # end of very long if-not-promote
|
||||
|
||||
cd $DESTDIR
|
||||
|
||||
@@ -430,17 +346,14 @@ else
|
||||
verboseflag=""
|
||||
fi
|
||||
echo "Creating $TARNAME ..."
|
||||
if [[ -e $TARNAME ]]; then
|
||||
mkdir -p previous
|
||||
mv -f $TARNAME previous
|
||||
fi
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
tar $verboseflag -hcf ${TARNAME%.gz} $XCATCORE
|
||||
rm -f $TARNAME
|
||||
gzip ${TARNAME%.gz}
|
||||
else
|
||||
tar $verboseflag -hjcf $TARNAME $XCATCORE
|
||||
fi
|
||||
chgrp $SYSGRP $TARNAME
|
||||
chgrp xcat $TARNAME
|
||||
chmod g+w $TARNAME
|
||||
|
||||
# Decide whether to upload or not
|
||||
@@ -494,15 +407,8 @@ if [ "$OSNAME" != "AIX" -a "$REL" = "devel" -a "$PROMOTE" != 1 -a -z "$EMBED" ];
|
||||
rpm2cpio ../$XCATCORE/xCAT-client-*.$NOARCH.rpm | cpio -id '*.html'
|
||||
rpm2cpio ../$XCATCORE/perl-xCAT-*.$NOARCH.rpm | cpio -id '*.html'
|
||||
rpm2cpio ../$XCATCORE/xCAT-test-*.$NOARCH.rpm | cpio -id '*.html'
|
||||
rpm2cpio ../$XCATCORE/xCAT-buildkit-*.$NOARCH.rpm | cpio -id '*.html'
|
||||
i=0
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync $verboseflag -r opt/xcat/share/doc/man1 opt/xcat/share/doc/man3 opt/xcat/share/doc/man5 opt/xcat/share/doc/man7 opt/xcat/share/doc/man8 $UPLOADUSER,xcat@web.sourceforge.net:htdocs/
|
||||
do : ; done
|
||||
|
||||
# extract and upload the tools readme
|
||||
rpm2cpio ../$XCATCORE/xCAT-server-*.$NOARCH.rpm | cpio -id ./opt/xcat/share/xcat/tools/README.html
|
||||
i=0
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync $verboseflag opt/xcat/share/xcat/tools/README.html $UPLOADUSER,xcat@web.sourceforge.net:htdocs/tools/
|
||||
do : ; done
|
||||
cd ..
|
||||
fi
|
||||
|
||||
+25
-31
@@ -97,15 +97,15 @@ if [ "$OSNAME" != "AIX" ]; then
|
||||
|
||||
# Sign the rpms that are not already signed. The "standard input reopened" warnings are normal.
|
||||
echo "Signing RPMs..."
|
||||
$XCATCOREDIR/build-utils/rpmsign.exp `find . -type f -name '*.rpm'` | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)'
|
||||
$XCATCOREDIR/build-utils/rpmsign.exp `find . -type f -name '*.rpm'` | grep -v -E '(was already signed|rpm --quiet --resign|WARNING: standard input reopened)'
|
||||
|
||||
# Create the repodata dirs
|
||||
echo "Creating repodata directories..."
|
||||
for i in `find -mindepth 2 -maxdepth 2 -type d `; do
|
||||
if [ -n "$VERBOSEMODE" ]; then
|
||||
createrepo --checksum sha $i # specifying checksum so the repo will work on rhel5
|
||||
createrepo $i
|
||||
else
|
||||
createrepo --checksum sha $i >/dev/null
|
||||
createrepo $i >/dev/null
|
||||
fi
|
||||
rm -f $i/repodata/repomd.xml.asc
|
||||
gpg -a --detach-sign $i/repodata/repomd.xml
|
||||
@@ -126,7 +126,7 @@ if [ "$OSNAME" != "AIX" ]; then
|
||||
fi
|
||||
|
||||
if [ "$OSNAME" == "AIX" ]; then
|
||||
# Build the instoss file ------------------------------------------
|
||||
# Build the instoss file
|
||||
|
||||
cat >instoss << 'EOF'
|
||||
#!/bin/ksh
|
||||
@@ -146,32 +146,22 @@ else
|
||||
fi
|
||||
cd $OSVER
|
||||
# Have to install rpms 1 at a time, since some may be already installed.
|
||||
# The only interdependency between the dep rpms so far is that net-snmp requires bash, and
|
||||
# pyodbc requires unixODBC. (The bash dependency is taken care of automatically because it
|
||||
# comes earlier in the alphabet.)
|
||||
|
||||
# first run /usr/sbin/updtvpkg to make sure any installp software is
|
||||
# registered with RPM.
|
||||
echo "Running updtvpkg. This could take a few minutes."
|
||||
/usr/sbin/updtvpkg
|
||||
echo "updtvpkg has completed."
|
||||
|
||||
# The only interdependency between the dep rpms so far is that net-snmp requires bash
|
||||
# pyodbc is dependent on unixODBC
|
||||
rpm -Uvh unixODBC*
|
||||
for i in `ls *.rpm|grep -v -E '^tcl-|^tk-|^expect-|^unixODBC-|^xCAT-UI-deps|^perl-DBD-DB2Lite'`; do
|
||||
for i in `ls *.rpm|grep -v -E '^tcl-|^tk-|^expect-|^unixODBC-|^xCAT-UI-deps'`; do
|
||||
if [ "$i" == "perl-Net-DNS-0.66-1.aix5.3.ppc.rpm" ]; then
|
||||
opts="--nodeps"
|
||||
else
|
||||
opts=""
|
||||
fi
|
||||
|
||||
# just in case we need it sometime, this next if stmt would mean: if it does not start with perl-DBD-DB2
|
||||
# this next if stmt means: if i does not start with perl-DBD-DB2
|
||||
#if [ "${i#perl-DBD-DB2}" == "$i" ]; then
|
||||
|
||||
echo rpm -Uvh $opts $i
|
||||
rpm -Uvh $opts $i
|
||||
echo rpm -Uvh $opts $i
|
||||
rpm -Uvh $opts $i
|
||||
#fi
|
||||
done
|
||||
# don't try to install tcl, tk, or expect if they are already installed!
|
||||
# this section about expect/tcl/tk can be removed once 2.8 releases, because 2.8 no longer requires expect
|
||||
lslpp -l | grep expect.base > /dev/null 2>&1
|
||||
if [ $? -gt 0 ]; then
|
||||
if [ "$OSVER" == "5.3" ]; then
|
||||
@@ -184,19 +174,24 @@ if [ $? -gt 0 ]; then
|
||||
fi
|
||||
fi
|
||||
EOF
|
||||
# end of instoss file content ---------------------------------------------
|
||||
# end of instoss file content
|
||||
|
||||
|
||||
chmod +x instoss
|
||||
fi
|
||||
|
||||
# Get the permissions and group correct
|
||||
# Get the permissions correct. Have to have all dirs/files with a group of xcat
|
||||
# and have them writeable by group, so any member of the xcat can build.
|
||||
if [ "$OSNAME" == "AIX" ]; then
|
||||
SYSGRP=system
|
||||
if ! lsgroup xcat >/dev/null 2>&1; then
|
||||
mkgroup xcat
|
||||
fi
|
||||
else
|
||||
SYSGRP=root
|
||||
if ! $GREP xcat /etc/group; then
|
||||
groupadd xcat
|
||||
fi
|
||||
fi
|
||||
chgrp -R $SYSGRP *
|
||||
chgrp -R xcat *
|
||||
chmod -R g+w *
|
||||
|
||||
# Build the tarball
|
||||
@@ -218,8 +213,7 @@ else
|
||||
echo "Creating $DFNAME ..."
|
||||
tar $verbosetar -jcf $DFNAME xcat-dep
|
||||
fi
|
||||
|
||||
#cd xcat-dep <-- now we want to stay above xcat-dep, so we can rsync the whole dir
|
||||
cd xcat-dep
|
||||
|
||||
if [ "$UP" == 0 ]; then
|
||||
exit 0;
|
||||
@@ -241,12 +235,12 @@ if [ "$FRSYUM" != 0 ]; then
|
||||
else
|
||||
links="-l"
|
||||
fi
|
||||
echo "Uploading RPMs from xcat-dep to $YUMDIR/$YUM/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync $links -ruv --delete xcat-dep $UPLOADUSER,xcat@web.sourceforge.net:$YUMDIR/$YUM/
|
||||
echo "Uploading RPMs to $YUMDIR/$YUM/xcat-dep/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync $links -ruv --delete * $UPLOADUSER,xcat@web.sourceforge.net:$YUMDIR/$YUM/xcat-dep/
|
||||
do : ; done
|
||||
|
||||
# Upload the tarball to the SF FRS Area
|
||||
i=0
|
||||
echo "Uploading $DFNAME to $FRS/xcat-dep/$FRSDIR/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -v $DFNAME $UPLOADUSER,xcat@web.sourceforge.net:$FRS/xcat-dep/$FRSDIR/
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -v ../$DFNAME $UPLOADUSER,xcat@web.sourceforge.net:$FRS/xcat-dep/$FRSDIR/
|
||||
do : ; done
|
||||
|
||||
@@ -13,11 +13,11 @@ then
|
||||
exit 1
|
||||
fi
|
||||
echo "The location for rpm building is ${RPMROOT}"
|
||||
cd `dirname $0`/xCAT-genesis-builder
|
||||
cd `dirname $0`/xCAT-nbroot2
|
||||
tar --exclude .svn -cjvf $RPMROOT/SOURCES/xCAT-genesis-builder.tar.bz2 .
|
||||
#mv -f *.gz $RPMROOT/SOURCES
|
||||
cp LICENSE.html $RPMROOT/BUILD
|
||||
cp xCAT-genesis-builder.spec $RPMROOT/SOURCES
|
||||
cd -
|
||||
rm -f $RPMROOT/SRPMS/xCAT-genesis-builder-$VER*rpm $RPMROOT/RPMS/*/xCAT-genesis-builder-$VER*rpm
|
||||
rpmbuild -ba xCAT-genesis-builder/xCAT-genesis-builder.spec
|
||||
rpmbuild -ba xCAT-nbroot2/xCAT-genesis-builder.spec
|
||||
|
||||
@@ -24,7 +24,7 @@ function makenoarch {
|
||||
else # linux
|
||||
echo "Building $RPMROOT/RPMS/noarch/$RPMNAME-$VER-snap*.noarch.rpm $EMBEDTXT..."
|
||||
tar --exclude .svn -czf $RPMROOT/SOURCES/$RPMNAME-$VER.tar.gz $RPMNAME
|
||||
rm -f $RPMROOT/SRPMS/$RPMNAME-$VER*rpm $RPMROOT/RPMS/noarch/$RPMNAME-$VER*rpm
|
||||
rm -f $RPMROOT/SRPMS/xCAT-server-$VER*rpm $RPMROOT/RPMS/noarch/$RPMNAME-$VER*rpm
|
||||
rpmbuild $QUIET -ta $RPMROOT/SOURCES/$RPMNAME-$VER.tar.gz
|
||||
RC=$?
|
||||
fi
|
||||
@@ -32,9 +32,9 @@ function makenoarch {
|
||||
|
||||
|
||||
|
||||
# Make one of the following rpms: xCAT, xCATsn, xCAT-buildkit, xCAT-OpenStack
|
||||
# Make one of the following rpms: xCAT, xCATsn
|
||||
function makexcat {
|
||||
if [ "$OSNAME" != "AIX" -a "$1" != "xCAT-buildkit" -a -z "$2" ]; then
|
||||
if [ "$OSNAME" != "AIX" -a -z "$2" ]; then
|
||||
echo 'Usage: makerpm <RPMname> <arch> [<embedded-system>]'
|
||||
exit 1
|
||||
fi
|
||||
@@ -68,36 +68,24 @@ function makexcat {
|
||||
RC=$?
|
||||
else # linux
|
||||
ARCH="$2"
|
||||
TARGET="--target $ARCH"
|
||||
cd `dirname $0`/$RPMNAME
|
||||
|
||||
if [ "$RPMNAME" = "xCAT" ]; then
|
||||
cd `dirname $0`/$RPMNAME
|
||||
tar --exclude .svn --exclude upflag -czf $RPMROOT/SOURCES/postscripts.tar.gz postscripts LICENSE.html
|
||||
tar --exclude .svn -czf $RPMROOT/SOURCES/postscripts.tar.gz postscripts LICENSE.html
|
||||
tar --exclude .svn -czf $RPMROOT/SOURCES/prescripts.tar.gz prescripts
|
||||
tar --exclude .svn -czf $RPMROOT/SOURCES/templates.tar.gz templates
|
||||
cp xcat.conf $RPMROOT/SOURCES
|
||||
cp xCATMN $RPMROOT/SOURCES
|
||||
cd - >/dev/null
|
||||
elif [ "$RPMNAME" = "xCATsn" ]; then
|
||||
cd `dirname $0`/$RPMNAME
|
||||
else # xCATsn
|
||||
tar --exclude .svn -czf $RPMROOT/SOURCES/license.tar.gz LICENSE.html
|
||||
cp xcat.conf $RPMROOT/SOURCES
|
||||
cp xCATSN $RPMROOT/SOURCES
|
||||
cd - >/dev/null
|
||||
elif [ "$RPMNAME" = "xCAT-buildkit" ]; then
|
||||
ARCH="noarch"
|
||||
TARGET=""
|
||||
tar --exclude .svn --exclude xCAT-buildkit.spec -czf $RPMROOT/SOURCES/$RPMNAME-$VER.tar.gz $RPMNAME
|
||||
elif [ "$RPMNAME" = "xCAT-OpenStack" ]; then
|
||||
tar --exclude .svn --exclude xCAT-OpenStack.spec -czf $RPMROOT/SOURCES/$RPMNAME-$VER.tar.gz $RPMNAME
|
||||
else # do not recognize rpm
|
||||
echo "Unrecognized rpm: $RPMNAME"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
cd - >/dev/null
|
||||
rm -f $RPMROOT/SRPMS/$RPMNAME-$VER*rpm $RPMROOT/RPMS/$ARCH/$RPMNAME-$VER*rpm
|
||||
echo "Building $RPMROOT/RPMS/$ARCH/$RPMNAME-$VER-snap*.$ARCH.rpm $EMBEDTXT..."
|
||||
rpmbuild $QUIET -ba $RPMNAME/$RPMNAME.spec $TARGET
|
||||
rpmbuild $QUIET -ba $RPMNAME/$RPMNAME.spec --target $ARCH
|
||||
RC=$?
|
||||
fi
|
||||
}
|
||||
@@ -127,9 +115,9 @@ function makenbroot {
|
||||
|
||||
|
||||
|
||||
# Make the xCAT-genesis rpm
|
||||
# Make the xCAT-nbroot-core rpm
|
||||
function makegenesis {
|
||||
DIR="xCAT-genesis-builder"
|
||||
DIR="xCAT-nbroot2"
|
||||
RPMNAME="$1"
|
||||
cd `dirname $0`/$DIR
|
||||
tar --exclude .svn -cjf $RPMROOT/SOURCES/$RPMNAME.tar.bz2 .
|
||||
@@ -140,25 +128,6 @@ function makegenesis {
|
||||
echo "Building $RPMROOT/RPMS/noarch/$RPMNAME-$VER-snap*.noarch.rpm $EMBEDTXT..."
|
||||
rpmbuild $QUIET -ba $DIR/$RPMNAME.spec
|
||||
}
|
||||
function makegenesisscripts {
|
||||
DIR="xCAT-genesis-scripts"
|
||||
if [ -z "$2" ]; then
|
||||
echo 'Usage: makerpm xCAT-genesis-scripts <arch> [<embedded-system>]'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
RPMNAME="$1"
|
||||
ARCH="$2"
|
||||
TARGET="--target $ARCH"
|
||||
cd `dirname $0`/
|
||||
tar --exclude .svn -cjf $RPMROOT/SOURCES/$RPMNAME.tar.bz2 $DIR
|
||||
cp $DIR/LICENSE.html $RPMROOT/BUILD
|
||||
cp $DIR/$RPMNAME.spec $RPMROOT/SOURCES
|
||||
cd - >/dev/null
|
||||
rm -f $RPMROOT/SRPMS/$RPMNAME-$ARCH-$VER*rpm $RPMROOT/RPMS/noarch/$RPMNAME-$ARCH-$VER*rpm
|
||||
echo "Building $RPMROOT/RPMS/noarch/$RPMNAME-$ARCH-$VER-snap*.noarch.rpm $EMBEDTXT..."
|
||||
rpmbuild $QUIET -ba $DIR/$RPMNAME.spec $TARGET
|
||||
}
|
||||
|
||||
|
||||
# Export the name of the embedded system we are building for
|
||||
@@ -203,18 +172,15 @@ else # linux
|
||||
fi
|
||||
|
||||
|
||||
if [ "$1" = "xCAT" -o "$1" = "xCATsn" -o "$1" = "xCAT-buildkit" -o "$1" = "xCAT-OpenStack" ]; then
|
||||
if [ "$1" = "xCAT" -o "$1" = "xCATsn" ]; then
|
||||
exportEmbed $3
|
||||
makexcat $1 $2
|
||||
elif [ "$1" = "xCAT-nbroot" -o "$1" = "xCAT-nbroot-core" ]; then
|
||||
exportEmbed $3
|
||||
makenbroot xCAT-nbroot-core $2
|
||||
elif [ "$1" = "xCAT-genesis-builder" ]; then
|
||||
exportEmbed $2
|
||||
makegenesis $1
|
||||
elif [ "$1" = "xCAT-genesis-scripts" ]; then
|
||||
exportEmbed $3
|
||||
makegenesisscripts $1 $2
|
||||
makegenesis $1 $2
|
||||
else # must be one of the noarch rpms
|
||||
exportEmbed $2
|
||||
makenoarch $1
|
||||
|
||||
+51
-61
@@ -157,69 +157,61 @@ B<tabedit> or B<chtab> commands. They can be viewed using B<nodels> or B<tabdum
|
||||
|
||||
Alternatively, the xCAT database can be viewed and edited as logical objects, instead of flat tables.
|
||||
In this mode, xCAT takes care of which table each attribute should go in. To treat the database
|
||||
as logical object definitions, use the commands: B<lsdef>, B<mkdef>, B<chdef>, B<rmdef>. See Object Definitions
|
||||
as logical object definitions, use the commands: lsdef, mkdef, chdef, rmdef. See Object Definitions
|
||||
below.
|
||||
|
||||
xCAT allows the use of different database applications, depending on the needs of your cluster.
|
||||
The default database is SQLite, which is a daemonless, zero-config database. But you could instead
|
||||
choose to use something like postgresql for greater scalability and remote access in the
|
||||
hierarchical/service node case. To use a different database or a different location, create
|
||||
the file /etc/xcat/cfgloc. See the appropriate xCAT docuementation for the format of the file for the database you choose.
|
||||
The following example /etc/xcat/cfgloc file is for PostgreSQL:
|
||||
the file /etc/xcat/cfgloc.
|
||||
See the appropriate xCAT docuementation for the format of the file for the database you choose.
|
||||
The following example is for PostgreSQL:
|
||||
|
||||
Pg:dbname=xcat;host=<mgmtnode>|<pgadminuserid>|<pgadminpasswd>
|
||||
|
||||
=over 4
|
||||
|
||||
=item Pg:dbname=xcat;host=<mgmtnode>|<pgadminuserid>|<pgadminpasswd>
|
||||
|
||||
where mgmtnode is the hostname of the management node adapter on the cluster side, and the pgadminuserid and pgadminpasswd are the database admin and password.
|
||||
|
||||
=head2 GROUPS AND REGULAR EXPRESSIONS IN TABLES
|
||||
=back
|
||||
|
||||
The xCAT database has a number of tables, some with rows that are keyed by node name
|
||||
(such as noderes and nodehm) and others that are not keyed by node name (for example, the policy table).
|
||||
The tables that are keyed by node name have some extra features that enable a more
|
||||
The xCAT database spans a number of tables, some with records associated with particular nodes
|
||||
(such as nodelist and nodehm) and others that do not have a direct relationship with any given node.
|
||||
The tables not associated with a given node are straightforward, the data is stored and retrieved
|
||||
as-is from the database without interpretation, and without any generic inheritance
|
||||
(though some calling code may implement inheritance for specific fields, for example
|
||||
nodehm.power inheriting from nodehm.mgt).
|
||||
|
||||
The tables with records typically retrieved by node name have some extra features to enable a more
|
||||
template-based style to be used:
|
||||
|
||||
Any group name can be used in lieu of a node name in the node field, and that row will then
|
||||
provide "default" attribute values for any node in that group. A row with a specific node name
|
||||
can then override one or more attribute values for that specific node. For example, if the nodehm table contains:
|
||||
Any group name can be used in lieu of a node name in the node field, and that record will then
|
||||
be taken to be applicable to any node in that group. If a field is requested for a specific node,
|
||||
and either a record doesn't exist specifically for that nodename or a record exists, but has no
|
||||
definition for the requested field, that node's groups are then used to search for
|
||||
records. If multiple records could apply from two different groups, the precedence is
|
||||
the order the groups are specified in the nodelist table for that node. This is nearly identical to
|
||||
most xCAT 1.x tab file conventions. This is useful in tables such as noderes, where typical
|
||||
configurations have exactly the same field values for large sets of nodes.
|
||||
|
||||
#node,power,mgt,cons,termserver,termport,conserver,serialport,serialspeed,serialflow,getmac,cmdmapping,comments,disable
|
||||
"mygroup",,"ipmi",,,,,,"19200",,,,,
|
||||
"node1",,,,,,,,"115200",,,,,
|
||||
xCAT 2 extends the above to be made useful where a field will vary for every node with a given tag,
|
||||
but in ways that would be trivial to describe. If a field is of the format /I<pattern>/I<replacement>/,
|
||||
it is taken to be a perl regular expression, to be performed on the nodename. For example, the bmc field
|
||||
of the ipmi table might be B</\z/-bmc/> for a record with node=ipmi to specify that the BMC hostname is derived
|
||||
by appending B<-bmc> to the end of the nodename of every node in the ipmi group.
|
||||
|
||||
In the above example, the node group called mygroup sets mgt=ipmi and serialspeed=19200. Any nodes that are in this group
|
||||
will have those attribute values, unless overridden. For example, if node2 is a member of mygroup, it will automatically
|
||||
inherit these attribute values (even though it is not explicitly listed in this table). In the case of node1 above, it
|
||||
inherits mgt=ipmi, but overrides the serialspeed to be 115200, instead of 19200. A useful, typical way to use this
|
||||
capability is to create a node group for your nodes and for all the attribute values that are the same for every node,
|
||||
set them at the group level. Then you only have to set attributes for each node that vary from node to node.
|
||||
As an extension to the above, a regular expression extended with arithmetic operators is available,
|
||||
by using the format |I<pattern>|I<replacement>|. This behaves similarly to the above, but () enclosed parts
|
||||
in I<replacement> are taken to signify arithmetic operations and substituted in. All operations are integer
|
||||
arithmetic, so 5/4 would come out as 1. The typical perl positional variables are available in such expressions.
|
||||
|
||||
xCAT extends the group capability so that it can also be used for attribute values that vary from node to node
|
||||
in a very regular pattern. For example, if in the ipmi table you want the bmc attribute to be set to whatever the nodename is with
|
||||
"-bmc" appended to the end of it, then use this in the ipmi table:
|
||||
For example, if you have many blades in your cluster and their hostnames have a regular
|
||||
pattern of blade1, blade2, etc., and your BladeCenter management modules also have a hostname
|
||||
pattern of amm1, amm2, etc., then your B<mp> table could be expressed by the following single row:
|
||||
|
||||
#node,bmc,bmcport,taggedvlan,bmcid,username,password,comments,disable
|
||||
"compute","/\z/-bmc/",,,,,,,
|
||||
|
||||
In this example, "compute" is a node group that contains all of the compute nodes. The 2nd attribute (bmc) is a regular
|
||||
expression that is similar to a substitution pattern. The 1st part "\z" matches the end of the node name and substitutes "-bmc", effectively appending it to the node name.
|
||||
|
||||
Another example is if node1 is to have IP address 10.0.0.1, node2 is to have IP address 10.0.0.2, etc.,
|
||||
then this could be represented in the hosts table with the single row:
|
||||
|
||||
#node,ip,hostnames,otherinterfaces,comments,disable
|
||||
"compute","|node(\d+)|10.0.0.($1+0)|",,,,
|
||||
|
||||
In this example, the regular expression in the ip attribute uses "|" to separate the 1st and 2nd part. This means that
|
||||
xCAT will allow arithmetic operations in the 2nd part. In the 1st part, "(\d+)", will match the number part of the node
|
||||
name and put that in a variable called $1. The 2nd part
|
||||
is what value to give the ip attribute. In this case it will set it to the string "10.0.0." and the number that is
|
||||
in $1. (Zero is added to $1 just to remove any leading zeroes.)
|
||||
|
||||
A more involved example is with the mp table. If your blades have node names node01, node02, etc., and your chassis
|
||||
node names are cmm01, cmm02, etc., then you might have an mp table like:
|
||||
|
||||
#node,mpa,id,nodetype,comments,disable
|
||||
"blade","|\D+(\d+)|cmm(sprintf('%02d',($1-1)/14+1))|","|\D+(\d+)|(($1-1)%14+1)|",,
|
||||
"blade","|\D+(\d+)|amm(($1-1)/14+1)|","|\D+(\d+)|(($1-1)%14+1)|",,
|
||||
|
||||
Before you panic, let me explain each column:
|
||||
|
||||
@@ -229,34 +221,32 @@ Before you panic, let me explain each column:
|
||||
|
||||
This is a group name. In this example, we are assuming that all of your blades belong to this
|
||||
group. Each time the xCAT software accesses the B<mp> table to get the management module and slot number
|
||||
of a specific blade (e.g. B<node20>), this row will match (because B<node20> is in the B<blade> group).
|
||||
Once this row is matched for B<node20>, then the processing described in the following items will take
|
||||
of a specific blade (e.g. B<blade20>), this row will match (because B<blade20> is in the B<blade> group).
|
||||
Once this row is matched for B<blade20>, then the processing described in the following items will take
|
||||
place.
|
||||
|
||||
=item B<|\D+(\d+)|cmm(sprintf('%02d',($1-1)/14+1))|>
|
||||
=item B<|\D+(\d+)|amm(($1-1)/14+1)|>
|
||||
|
||||
This is a perl substitution pattern that will produce the value for the second column of the table (the
|
||||
management module hostname). The text B<\D+(\d+)> between the 1st two vertical bars is
|
||||
management module hostname).
|
||||
The text B<\D+(\d+)> between the 1st two vertical bars is
|
||||
a regular expression that matches the node
|
||||
name that was searched for in this table (in this example B<node20>). The text that matches
|
||||
name that was searched for in this table (in this example B<blade20>). The text that matches
|
||||
within the 1st set of parentheses is set to $1. (If there was a 2nd set of parentheses, it would
|
||||
be set to $2, and so on.) In our case, the \D+ matches the non-numeric part of the name
|
||||
(B<node>) and the B<\d+> matches the numeric part (B<20>). So $1 is set to B<20>. The text B<cmm(sprintf('%02d',($1-1)/14+1))> between the
|
||||
2nd and 3rd vertical bars produces the string that should be used as the value for the mpa attribute for node20.
|
||||
Since $1 is set to 20, the expression B<($1-1)/14+1> equals
|
||||
19/14 + 1, which equals 2. (The division is integer division,
|
||||
so 19/14 equals 1. Fourteen is used as the divisor, because there are 14 blades in each chassis.) The value of 2 is then passed into sprintf() with a format string to add a leading
|
||||
zero, if necessary, to always make the number two digits. Lastly the string B<cmm> is added to the beginning,
|
||||
making the resulting string B<cmm02>, which will be used as the hostname
|
||||
(B<blade>) and the \d+ matches the numeric part (B<20>). So $1 is set to B<20>. The text B<amm(($1-1)/14+1)> between the
|
||||
2nd and 3rd vertical bars produces the string that should be used as the value
|
||||
for this column in a hypothetical row for blade20. Since $1 is set to 20, the expression B<($1-1)/14+1> equals
|
||||
19/14 + 1, which equals 2. Therefore the whole string is B<amm2>, which will be used as the hostname
|
||||
of the management module.
|
||||
|
||||
=item B<|\D+(\d+)|(($1-1)%14+1)|>
|
||||
|
||||
This item is similar to the one above. This substituion pattern will produce the value for
|
||||
the 3rd column (the chassis slot number for this blade). Because this row was
|
||||
the match for B<node20>, the parentheses
|
||||
the 3rd column (the BladeCenter chassis slot number for this blade). Because this row was
|
||||
the match for B<blade20>, the parentheses
|
||||
within the 1st set of vertical bars will set $1 to 20. Since % means modulo division, the
|
||||
expression B<($1-1)%14+1> will evaluate to B<6>.
|
||||
expression B<($1-1)%14+1> will evaluate to 6.
|
||||
|
||||
=back
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Source: perl-xcat
|
||||
Section: libs
|
||||
Priority: extra
|
||||
Maintainer: xCAT <xcat-user@lists.sourceforge.net>
|
||||
Build-Depends: debhelper (>= 5), libsoap-lite-perl, libdbi-perl
|
||||
Maintainer: Arif Ali <aali@ocf.co.uk>
|
||||
Build-Depends: debhelper (>= 5), libsoap-lite-perl
|
||||
Standards-Version: 3.7.2
|
||||
|
||||
Package: perl-xcat
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
xCAT/* /opt/xcat/lib/perl/xCAT/
|
||||
xCAT/* usr/lib/perl5/xCAT
|
||||
share/man/man5/* opt/xcat/share/man/man5
|
||||
share/doc/man5/* opt/xcat/share/doc/man5
|
||||
share/man/man7/* opt/xcat/share/man/man7
|
||||
share/doc/man7/* opt/xcat/share/doc/man7
|
||||
LICENSE.html opt/xcat/share/doc/packages/perl-xCAT
|
||||
README opt/xcat/
|
||||
README opt/xcat/
|
||||
@@ -14,6 +14,7 @@ export DH_COMPAT=5
|
||||
|
||||
build:
|
||||
dh_testdir
|
||||
./modifyUtils `cat ../Version`
|
||||
./db2man
|
||||
|
||||
clean:
|
||||
@@ -25,7 +26,7 @@ install:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_installdirs
|
||||
dh_install -X".svn"
|
||||
dh_install
|
||||
|
||||
|
||||
# Build architecture-independent files here.
|
||||
@@ -39,7 +40,7 @@ binary-arch: build install
|
||||
dh_installchangelogs
|
||||
dh_installdocs
|
||||
# dh_installexamples
|
||||
dh_install -X".svn"
|
||||
dh_install
|
||||
chmod 644 `pwd`/debian/perl-xcat/opt/xcat/lib/perl/xCAT/*
|
||||
chmod 755 `pwd`/debian/perl-xcat/opt/xcat/lib/perl/xCAT/data
|
||||
chmod 644 `pwd`/debian/perl-xcat/opt/xcat/share/doc/packages/perl-xCAT/*
|
||||
@@ -48,7 +49,6 @@ binary-arch: build install
|
||||
chmod 644 `pwd`/debian/perl-xcat/opt/xcat/share/doc/man5/*
|
||||
chmod 644 `pwd`/debian/perl-xcat/opt/xcat/share/man/man7/*
|
||||
chmod 644 `pwd`/debian/perl-xcat/opt/xcat/share/doc/man7/*
|
||||
./modifyUtils `cat ../Version` `svn info | grep Revision | cut -d" " -f 2`
|
||||
# dh_installmenu
|
||||
# dh_installdebconf
|
||||
# dh_installlogrotate
|
||||
|
||||
+18
-10
@@ -1,26 +1,34 @@
|
||||
#!/bin/sh
|
||||
# Put the version, svn revision #, and build date into the Version function in Version.pm
|
||||
|
||||
if [ -z "$1" ]
|
||||
if [ -z "$2" ]
|
||||
then
|
||||
echo "modifyUtils: Error: must specify the xCAT version as an argument" >&2
|
||||
echo "modifyUtils: Error: must specify the xCAT version and svn revision number as arguments" >&2
|
||||
exit
|
||||
fi
|
||||
|
||||
VER=$1
|
||||
SVNREF="svn r$2, "
|
||||
|
||||
#SVNINFO=`svn info 2>/dev/null|grep Revision`
|
||||
#/bin/echo -e $SVNINFO
|
||||
#if [ $? -ne 0 -a -f .svninfo ]; then
|
||||
# SVNINFO=`cat .svninfo 2>/dev/null|grep Revision`
|
||||
#fi
|
||||
#if [ $? -eq 0 ]
|
||||
# then
|
||||
# SVNREF="svn r"`echo $SVNINFO|awk '{print $2}'`", "
|
||||
# else
|
||||
# SVNREF=""
|
||||
# fi
|
||||
|
||||
BUILDDATE=`date`
|
||||
#echo ". '(built $BUILDDATE)'"
|
||||
#echo ". '(${SVNREF}built $BUILDDATE)'"
|
||||
|
||||
if [ "$(uname)" = "AIX" ]
|
||||
then
|
||||
sed -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' (built $BUILDDATE)'"/ xCAT/Version.pm >xCAT/Version.pm.new
|
||||
sed -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' (${SVNREF}built $BUILDDATE)'"/ xCAT/Version.pm >xCAT/Version.pm.new
|
||||
mv xCAT/Version.pm.new xCAT/Version.pm
|
||||
else
|
||||
if [ -f "/etc/debian_version" ];then
|
||||
FILENAME="debian/perl-xcat/opt/xcat/lib/perl/xCAT/Version.pm"
|
||||
else
|
||||
FILENAME="xCAT/Version.pm"
|
||||
fi
|
||||
sed -i -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' (built $BUILDDATE)'"/ $FILENAME
|
||||
sed -i -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' (${SVNREF}built $BUILDDATE)'"/ xCAT/Version.pm
|
||||
fi
|
||||
|
||||
+12
-20
@@ -24,7 +24,7 @@ Provides perl xCAT libraries for core functionality. Required for all xCAT inst
|
||||
Includes xCAT::Table, xCAT::NodeRange, among others.
|
||||
|
||||
%define zvm %(if [ "$zvm" = "1" ];then echo 1; else echo 0; fi)
|
||||
%define fsm %(if [ "$fsm" = "1" ];then echo 1; else echo 0; fi)
|
||||
%define svninfo %(svn info | grep Revision | awk '{print $2}')
|
||||
|
||||
%prep
|
||||
%setup -q -n perl-xCAT
|
||||
@@ -33,15 +33,12 @@ Includes xCAT::Table, xCAT::NodeRange, among others.
|
||||
# All of the tarball source has been unpacked there and is in the same file structure
|
||||
# as it is in svn.
|
||||
|
||||
%if %fsm
|
||||
%else
|
||||
# Modify the Version() function in xCAT/Utils.pm to automatically have the correct version
|
||||
./modifyUtils %{version}
|
||||
./modifyUtils %{version} %{svninfo}
|
||||
|
||||
# Build the pod version of the man pages for each DB table. It puts them in the man5 and man7 subdirs.
|
||||
# Then convert the pods to man pages and html pages.
|
||||
./db2man
|
||||
%endif
|
||||
|
||||
%install
|
||||
# The install phase puts all of the files in the paths they should be in when the rpm is
|
||||
@@ -78,18 +75,6 @@ rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/PPC*.pm
|
||||
cp xCAT/PPCdb.pm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/
|
||||
chmod 644 $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/PPCdb.pm
|
||||
%endif
|
||||
# Don't ship these on FSM, to reduce dependencies
|
||||
%if %fsm
|
||||
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/hpoa.pm
|
||||
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/vboxService.pm
|
||||
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/FSP*.pm
|
||||
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/RemoteShellExp.pm
|
||||
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/LparNetbootExp.pm
|
||||
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/PPC*.pm
|
||||
# have to put PPCdb.pm back because it is needed by Postage.pm
|
||||
cp xCAT/PPCdb.pm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/
|
||||
chmod 644 $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/PPCdb.pm
|
||||
%endif
|
||||
|
||||
cp LICENSE.html $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/perl-xCAT
|
||||
chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/perl-xCAT/*
|
||||
@@ -97,8 +82,6 @@ chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/perl-xCAT/*
|
||||
cp README $RPM_BUILD_ROOT/%{prefix}
|
||||
chmod 644 $RPM_BUILD_ROOT/%{prefix}/README
|
||||
|
||||
%if %fsm
|
||||
%else
|
||||
# These were built dynamically in the build phase
|
||||
cp share/man/man5/* $RPM_BUILD_ROOT/%{prefix}/share/man/man5
|
||||
chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/man/man5/*
|
||||
@@ -108,7 +91,6 @@ cp share/man/man7/* $RPM_BUILD_ROOT/%{prefix}/share/man/man7
|
||||
chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/man/man7/*
|
||||
cp share/doc/man7/* $RPM_BUILD_ROOT/%{prefix}/share/doc/man7
|
||||
chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/doc/man7/*
|
||||
%endif
|
||||
|
||||
%clean
|
||||
# This step does not happen until *after* the %files packaging below
|
||||
@@ -140,8 +122,18 @@ fi
|
||||
if [ "$1" -gt 1 ]; then #Ugrade only, restart daemon and migrate settings
|
||||
if [ -x /etc/init.d/xcatd ] && [ -f "/proc/cmdline" ]; then
|
||||
. /etc/profile.d/xcat.sh
|
||||
/etc/init.d/xcatd reload
|
||||
fi
|
||||
fi
|
||||
%else
|
||||
if [ "$1" -gt 1 ]; then #Ugrade only, restart daemon and migrate settings
|
||||
if [ -n "$INUCLIENTS" ] && [ $INUCLIENTS -eq 1 ]; then
|
||||
#Do nothing in not running system
|
||||
echo "Do not restartxcatd in not running system"
|
||||
else
|
||||
XCATROOT=$RPM_INSTALL_PREFIX0 $RPM_INSTALL_PREFIX0/sbin/restartxcatd -r
|
||||
fi
|
||||
fi
|
||||
%endif
|
||||
exit 0
|
||||
|
||||
|
||||
@@ -1,821 +0,0 @@
|
||||
# IBM(c) 2012 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
package xCAT::CFMUtils;
|
||||
|
||||
BEGIN
|
||||
{
|
||||
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
|
||||
}
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use File::Path;
|
||||
use File::Copy;
|
||||
use File::Find;
|
||||
use Getopt::Long;
|
||||
use Data::Dumper;
|
||||
use File::Basename;
|
||||
use xCAT::Table;
|
||||
use xCAT::Utils;
|
||||
use xCAT::MsgUtils;
|
||||
1;
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 initCFMdir
|
||||
Initialize CFM directories and files. The default layout under cfmdir is:
|
||||
.
|
||||
|-- etc
|
||||
| |-- group.merge -> /etc/group.merge
|
||||
| |-- hosts -> /etc/hosts
|
||||
| |-- passwd.merge -> /etc/passwd.merge
|
||||
| |-- shadow.merge -> /etc/shadow.merge
|
||||
|-- group.OS -> /etc/group.OS
|
||||
|-- passwd.OS -> /etc/passwd.OS
|
||||
|-- shadow.OS -> /etc/shadow.OS
|
||||
Note: the *.OS files are the backups for the original /etc/passwd, shadow, group files
|
||||
|
||||
Arguments:
|
||||
$cfmdir
|
||||
Returns:
|
||||
0 - initialize successfully
|
||||
1 - initialize failed
|
||||
Globals:
|
||||
none
|
||||
Error:
|
||||
none
|
||||
Example:
|
||||
xCAT::CFMUtils->initCFMdir($cfmdir);
|
||||
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
sub initCFMdir
|
||||
{
|
||||
my ($class, $cfmdir) = @_;
|
||||
|
||||
# below system files will be synced to all compute nodes
|
||||
my @sysfiles = ("/etc/hosts");
|
||||
|
||||
# the /etc/passwd, shadow, group files will be merged
|
||||
my @userfiles = ("/etc/passwd", "/etc/shadow", "/etc/group");
|
||||
|
||||
# create the cfmdir
|
||||
if (! -d $cfmdir)
|
||||
{
|
||||
mkpath $cfmdir;
|
||||
}
|
||||
|
||||
# backup the OS files and create links under cfmdir
|
||||
foreach my $file (@userfiles)
|
||||
{
|
||||
my $backup = $file.".OS";
|
||||
if (! -e $backup)
|
||||
{
|
||||
copy($file, $backup);
|
||||
}
|
||||
|
||||
if (! -e "$cfmdir/".basename($backup))
|
||||
{
|
||||
symlink($backup, "$cfmdir/".basename($backup));
|
||||
}
|
||||
}
|
||||
|
||||
# Initialize CFM directory and related files
|
||||
if (! -d "$cfmdir/etc")
|
||||
{
|
||||
mkpath "$cfmdir/etc";
|
||||
}
|
||||
|
||||
# link the system files
|
||||
foreach my $file (@sysfiles)
|
||||
{
|
||||
symlink($file, "$cfmdir/$file");
|
||||
}
|
||||
# touch and link the merge files for /etc/passwd, shadow, group
|
||||
foreach my $file (@userfiles)
|
||||
{
|
||||
my $merge = $file.".merge";
|
||||
if (! -e "$merge")
|
||||
{
|
||||
xCAT::Utils->runcmd("touch $merge", -1);
|
||||
}
|
||||
|
||||
if (! -e "$cfmdir/$merge")
|
||||
{
|
||||
symlink($merge, "$cfmdir/$merge");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 updateUserInfo
|
||||
Update the /etc/passwd, shadow, group merge files under specified CFM directory
|
||||
|
||||
Arguments:
|
||||
$cfmdir - CFM directory for osimage
|
||||
Returns:
|
||||
0 - update successfully
|
||||
1 - update failed
|
||||
Globals:
|
||||
$::CALLBACK
|
||||
Error:
|
||||
none
|
||||
Example:
|
||||
my $ret = xCAT::CFMUtils->updateUserInfo($cfmdir);
|
||||
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
sub updateUserInfo {
|
||||
my ($class, $cfmdir) = @_;
|
||||
|
||||
my @userfiles = ("/etc/passwd", "/etc/shadow", "/etc/group");
|
||||
|
||||
my @osfiles = glob("$cfmdir/*.OS");
|
||||
if (!@osfiles)
|
||||
{
|
||||
if ($::VERBOSE)
|
||||
{
|
||||
my $rsp = {};
|
||||
$rsp->{data}->[0] = "Skiping the update of the /etc/passwd, shadow, group merge files under the CFM directory.";
|
||||
xCAT::MsgUtils->message("I", $rsp, $::CALLBACK);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
foreach my $file (@userfiles)
|
||||
{
|
||||
my @oldrecords = ();
|
||||
my @newrecords = ();
|
||||
my $backup = basename($file).".OS";
|
||||
|
||||
# get the records from /etc/passwd, shadow, group file and backup files(.OS files)
|
||||
# and all the files from /install/osimages/$imgname/cfmdir directory
|
||||
foreach my $userinfo ($file, "$cfmdir/$backup")
|
||||
{
|
||||
my $fp;
|
||||
open($fp, $userinfo);
|
||||
my @records = ();
|
||||
while (<$fp>)
|
||||
{
|
||||
my $line = xCAT::CFMUtils->trim($_);
|
||||
if (($line =~ /^#/) || ($line =~ /^\s*$/ ))
|
||||
{ #comment line or blank line
|
||||
next;
|
||||
} else
|
||||
{
|
||||
push @records, $line;
|
||||
}
|
||||
}
|
||||
close($fp);
|
||||
|
||||
# check the records from /etc/passwd, shadow, group file or backup
|
||||
if ($userinfo =~ /^\/etc/ )
|
||||
{
|
||||
@newrecords = @records;
|
||||
} else {
|
||||
@oldrecords = @records;
|
||||
}
|
||||
}
|
||||
|
||||
# update the merge file
|
||||
my $mergefile = $cfmdir."/".$file.".merge";
|
||||
my @diff = xCAT::CFMUtils->arrayops("D", \@newrecords, \@oldrecords);
|
||||
# output the diff to merge files
|
||||
my $fp;
|
||||
open($fp, '>', $mergefile);
|
||||
if (@diff)
|
||||
{
|
||||
for my $record (@diff)
|
||||
{
|
||||
# skip to add ROOT relative records into MERGE file
|
||||
if ($record =~ /^root/)
|
||||
{
|
||||
next;
|
||||
}
|
||||
print $fp "$record\n";
|
||||
}
|
||||
}
|
||||
close ($fp);
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
=head3 setCFMSynclistFile
|
||||
Set osimage synclists attribute for CFM function, the CMF synclist file is:
|
||||
/install/osimages/<imagename>/synclist.cfm
|
||||
|
||||
Arguments:
|
||||
$imagename - the specified osimage name
|
||||
Returns:
|
||||
It returns the cfmdir path if it is defined for an osimage object
|
||||
Globals:
|
||||
$::CALLBACK
|
||||
Error:
|
||||
none
|
||||
Example:
|
||||
my $cfmdir = xCAT::CFMUtils->setCFMSynclistFile($imagename);
|
||||
if ($cfmdir) { # update the CFM synclist file }
|
||||
=cut
|
||||
#-----------------------------------------------------------------------------
|
||||
sub setCFMSynclistFile {
|
||||
my ($class, $img) = @_;
|
||||
|
||||
my $cfmdir;
|
||||
my $synclists;
|
||||
my $cfmsynclist = "/install/osimages/$img/synclist.cfm";
|
||||
|
||||
# get the cfmdir and synclists attributes
|
||||
my $osimage_t = xCAT::Table->new('osimage');
|
||||
my $records = $osimage_t->getAttribs({imagename=>$img}, 'cfmdir', 'synclists');
|
||||
if (defined ($records->{'cfmdir'}))
|
||||
{
|
||||
$cfmdir = $records->{'cfmdir'};
|
||||
if (defined ($records->{'synclists'})) {$synclists = $records->{'synclists'}}
|
||||
} else {
|
||||
# no cfmdir defined, return directly
|
||||
return 0;
|
||||
}
|
||||
|
||||
my $found = 0;
|
||||
my $index = 0;
|
||||
if ($synclists)
|
||||
{
|
||||
# the synclists is a comma separated list
|
||||
my @lists = split(/,/, $synclists);
|
||||
foreach my $synclist (@lists)
|
||||
{
|
||||
# find the synclist configuration for CFM
|
||||
if ($synclist eq $cfmsynclist)
|
||||
{
|
||||
$found = 1;
|
||||
last;
|
||||
}
|
||||
$index += 1;
|
||||
}
|
||||
if ($found == 0)
|
||||
{
|
||||
# the CFM synclist is not defined, append it to $synclists
|
||||
$synclists = "$synclists,$cfmsynclist";
|
||||
# set the synclists attribute
|
||||
$osimage_t->setAttribs({imagename=>$img}, {'synclists' => $synclists});
|
||||
}
|
||||
} else {
|
||||
# no synclists defined, set it to CFM synclist file
|
||||
if ($cfmdir) { $synclists = $cfmsynclist; }
|
||||
$osimage_t->setAttribs({imagename=>$img}, {'synclists' => $synclists});
|
||||
}
|
||||
|
||||
return $cfmdir;
|
||||
}
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 updateCFMSynclistFile
|
||||
Update the synclist file(/install/osimages/<imagename>/synclist.cfm) for CFM function.
|
||||
It will recursively scan the files under cfmdir directory and then add them to CFM synclist file.
|
||||
Note:
|
||||
The files with suffix ".append" will be appended to the dest file(records in "APPEND:" section).
|
||||
The files with suffix ".merge" will be merged to the dest file(records in "MERGE:" section).
|
||||
|
||||
In addition, it will reserve the user specified records in the synclist file. The example synclist file:
|
||||
<cfmdir>/etc/hosts -> /etc/hosts
|
||||
/root/install.log -> /tmp/install.log
|
||||
...
|
||||
|
||||
APPEND:
|
||||
<cfmdir>/etc/hosts.append -> /etc/hosts
|
||||
/root/install.log.syslog -> /tmp/install.log
|
||||
...
|
||||
EXECUTE:
|
||||
...
|
||||
EXECUTEALWAYS:
|
||||
...
|
||||
MERGE:
|
||||
<cfmdir>/etc/group.merge -> /etc/group
|
||||
<cfmdir>/etc/shadow.merge -> /etc/shadow
|
||||
<cfmdir>/etc/passwd.merge -> /etc/passwd
|
||||
|
||||
Arguments:
|
||||
\@imagenames - reference to the osimage names array
|
||||
Returns:
|
||||
0 - update successfully
|
||||
1 - update failed
|
||||
Globals:
|
||||
$::CALLBACK
|
||||
Error:
|
||||
none
|
||||
Example:
|
||||
my $ret = CAT::CFMUtils->updateCFMSynclistFile(\@imagenames);
|
||||
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
sub updateCFMSynclistFile {
|
||||
my ($class, $imgs) = @_;
|
||||
|
||||
my @osimgs = @$imgs;
|
||||
if (!@osimgs)
|
||||
{
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] = "No osimage names specified to process.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
|
||||
return 1;
|
||||
}
|
||||
|
||||
foreach my $osimg (@osimgs)
|
||||
{
|
||||
my $cfmdir;
|
||||
$cfmdir = xCAT::CFMUtils->setCFMSynclistFile($osimg);
|
||||
if ($cfmdir) # check for /install/osiamges/$osimg/cfmdir
|
||||
{
|
||||
my $cfmsynclist = "/install/osimages/$osimg/synclist.cfm";
|
||||
if (! -d $cfmdir)
|
||||
{
|
||||
# skip this one go on to the next image, nothing to do for
|
||||
# CFMUtils in this image
|
||||
next;
|
||||
}
|
||||
# create the parent directory of CFM synclist file
|
||||
if (! -d dirname($cfmsynclist))
|
||||
{
|
||||
mkpath dirname($cfmsynclist);
|
||||
}
|
||||
|
||||
# update /etc/passwd, shadow, group merge files
|
||||
my $ret = xCAT::CFMUtils->updateUserInfo($cfmdir);
|
||||
if ($ret !=0 )
|
||||
{
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] =
|
||||
"Update /etc/passwd, shadow, group merge files failed.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
|
||||
return 1;
|
||||
}
|
||||
|
||||
# recursively list the files under cfm directory
|
||||
my @files = ();
|
||||
|
||||
find ( { wanted => sub { push @files, $File::Find::name if -f }, follow => 1 }, $cfmdir);
|
||||
if (!@files) # not files under cfm directory, skip to next loop
|
||||
{
|
||||
next;
|
||||
}
|
||||
|
||||
my $fp;
|
||||
open($fp, '>', $cfmsynclist);
|
||||
my @mergefiles = ();
|
||||
my @appendfiles = ();
|
||||
foreach my $file (@files)
|
||||
{
|
||||
my $name = basename($file);
|
||||
#TODO: find a better way to get the suffix
|
||||
my $suffix = ($name =~ m/([^.]+)$/)[0];
|
||||
my $dest = substr($file, length($cfmdir));
|
||||
if ($suffix eq "OS") # skip the backup files
|
||||
{
|
||||
next;
|
||||
} elsif ($suffix eq "merge") # merge file
|
||||
{
|
||||
push(@mergefiles, $file);
|
||||
} elsif ($suffix eq "append") { # append file
|
||||
push(@appendfiles, $file);
|
||||
} else { # output the syncing files maintained by CFM
|
||||
print $fp "$file -> $dest\n";
|
||||
}
|
||||
}
|
||||
|
||||
# output the APPEND records maintained by CFM
|
||||
if (@appendfiles) {
|
||||
print $fp "APPEND:\n";
|
||||
}
|
||||
foreach my $file (@appendfiles)
|
||||
{
|
||||
my $dest = substr($file, length($cfmdir), length($file) - length(".append") - length($cfmdir));
|
||||
print $fp "$file -> $dest\n";
|
||||
}
|
||||
|
||||
# output the MERGE records maintained by CFM
|
||||
if (@mergefiles) {
|
||||
print $fp "MERGE:\n";
|
||||
}
|
||||
foreach my $file (@mergefiles)
|
||||
{
|
||||
my @userfiles = ("/etc/passwd", "/etc/shadow", "/etc/group");
|
||||
my $dest = substr($file, length($cfmdir), length($file) - length(".merge") - length($cfmdir));
|
||||
# only /etc/passwd, /etc/shadow, /etc/groups merging is supported
|
||||
if (grep(/$dest/, @userfiles)) {
|
||||
print $fp "$file -> $dest\n";
|
||||
}
|
||||
}
|
||||
|
||||
# close the file
|
||||
close($fp);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
=head3 setCFMPkglistFile
|
||||
Set the pkglist attribute of linuximage object for CFM function
|
||||
|
||||
Arguments:
|
||||
$imagename - the specified linuximage name
|
||||
Returns:
|
||||
0 - update successfully
|
||||
1 - update failed
|
||||
Globals:
|
||||
$::CALLBACK
|
||||
Error:
|
||||
none
|
||||
Example:
|
||||
my $ret = xCAT::CFMUtils->setCFMPkglistFile($imagename);
|
||||
=cut
|
||||
#-----------------------------------------------------------------------------
|
||||
sub setCFMPkglistFile {
|
||||
my ($class, $img) = @_;
|
||||
|
||||
my $pkglists = "";
|
||||
my $cfmpkglist = "/install/osimages/$img/pkglist.cfm";
|
||||
|
||||
# get the pkglist files
|
||||
my $linuximage_t = xCAT::Table->new('linuximage');
|
||||
my $records = $linuximage_t->getAttribs({imagename => $img}, 'pkglist');
|
||||
if ($records)
|
||||
{
|
||||
if ($records->{'pkglist'}) { $pkglists = $records->{'pkglist'}; }
|
||||
} else
|
||||
{
|
||||
if ($::VERBOSE)
|
||||
{
|
||||
my $rsp = {};
|
||||
$rsp->{data}->[0] = "There are no records for pkglist attribute in the linuximage:$img. There is nothing to process.";
|
||||
xCAT::MsgUtils->message("I", $rsp, $::CALLBACK);
|
||||
}
|
||||
}
|
||||
|
||||
my $found = 0;
|
||||
if ($pkglists)
|
||||
{
|
||||
foreach my $pkglist (split(/,/, $pkglists))
|
||||
{
|
||||
if ($pkglist eq $cfmpkglist) # the pkglist file for CFM is found, exit the loop
|
||||
{
|
||||
$found = 1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
# the pkglist file for CFM is not found, append it to $pkglits
|
||||
if (!$found)
|
||||
{
|
||||
$pkglists = "$pkglists,$cfmpkglist";
|
||||
# set the pkglist attribute for linuximage
|
||||
$linuximage_t->setAttribs({imagename => $img}, {'pkglist' => $pkglists});
|
||||
}
|
||||
} else
|
||||
{
|
||||
# the pkglist file for linuximage is not defined, set it to $cfmpkglist
|
||||
$pkglists = $cfmpkglist;
|
||||
$linuximage_t->setAttribs({imagename => $img}, {'pkglist' => $pkglists});
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 updateCFMPkglistFile
|
||||
Update the ospkglist file
|
||||
|
||||
Arguments:
|
||||
$imagename - the specified linuximage name
|
||||
@curospkgs - the currently selected OS packages list
|
||||
Returns:
|
||||
0 - update successfully
|
||||
1 - update failed
|
||||
Globals:
|
||||
none
|
||||
Error:
|
||||
none
|
||||
Example:
|
||||
my $ret = CAT::CFMUtils->updateCFMPkglistFile($imagename, @cur_selected_pkgs);
|
||||
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
sub updateCFMPkglistFile {
|
||||
my ($class, $img, $ospkgs) = @_;
|
||||
|
||||
my @cur_selected = @$ospkgs;
|
||||
my $cfmpkglist = "/install/osimages/$img/pkglist.cfm";
|
||||
|
||||
my $ret = xCAT::CFMUtils->setCFMPkglistFile($img);
|
||||
if ($ret)
|
||||
{
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] = "Set pkglist attribute for CFM failed.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
|
||||
return 1;
|
||||
}
|
||||
|
||||
# check the parent directory of cfmpkglist file
|
||||
if (! -d dirname($cfmpkglist))
|
||||
{
|
||||
mkpath dirname($cfmpkglist);
|
||||
}
|
||||
|
||||
# get previous selected and removed OS packages list from pkglist file
|
||||
my ($pre_selected_ref, $pre_removed_ref) = xCAT::CFMUtils->getPreOSpkgsList($cfmpkglist);
|
||||
my @pre_selected = @$pre_selected_ref;
|
||||
my @pre_removed = @$pre_removed_ref;
|
||||
|
||||
# get the #INCLUDE file from cfmpkglist file
|
||||
my @incfiles = xCAT::CFMUtils->getIncludefiles($cfmpkglist);
|
||||
# get the packages list in the #INCLUDE files
|
||||
my @basepkgs = ();
|
||||
foreach my $inc (@incfiles)
|
||||
{
|
||||
my ($selected_ref, $removed_ref) = xCAT::CFMUtils->getPreOSpkgsList($inc);
|
||||
my @selected = @$selected_ref;
|
||||
@basepkgs = xCAT::CFMUtils->arrayops("U", \@basepkgs, \@selected);
|
||||
}
|
||||
|
||||
# get diff between previous and current selected OS packages lists
|
||||
my @diff = xCAT::CFMUtils->getPkgsDiff(\@pre_selected, \@cur_selected);
|
||||
|
||||
# merge the diff to previous removed OS packages list
|
||||
my @all_removed = xCAT::CFMUtils->arrayops("U", \@pre_removed, \@diff);
|
||||
|
||||
# get the rollbacked OS packages list, the packages are existing in both removed and selected lists
|
||||
# if so, we should remove the rollbacked OS packages from removed list
|
||||
my @rollback = xCAT::CFMUtils->arrayops("I", \@all_removed, \@cur_selected);
|
||||
my @cur_removed = xCAT::CFMUtils->arrayops("D", \@all_removed, \@rollback);
|
||||
|
||||
# remove the BASE packages from selected pakages
|
||||
@basepkgs = xCAT::CFMUtils->arrayops("I", \@basepkgs, \@cur_selected);
|
||||
@cur_selected = xCAT::CFMUtils->arrayops("D", \@cur_selected, \@basepkgs);
|
||||
|
||||
# update the pkglist file
|
||||
my $fp;
|
||||
open($fp, '>', $cfmpkglist);
|
||||
foreach my $inc (@incfiles)
|
||||
{
|
||||
print $fp "#INCLUDE:$inc#\n";
|
||||
}
|
||||
# the pacakges be installed
|
||||
if (@cur_selected)
|
||||
{
|
||||
foreach my $pkg (@cur_selected)
|
||||
{
|
||||
print $fp "$pkg\n";
|
||||
}
|
||||
}
|
||||
# the packages be removed
|
||||
if (@cur_removed)
|
||||
{
|
||||
foreach my $pkg (@cur_removed)
|
||||
{
|
||||
print $fp "-$pkg\n";
|
||||
}
|
||||
}
|
||||
# close the file
|
||||
close($fp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 getPreOSpkgsList
|
||||
Get previously selected and removed OS packages lists from pkglist file
|
||||
|
||||
Arguments:
|
||||
$ospkglist - the path for ospkglist file
|
||||
Returns:
|
||||
refs for selected and removed OS packages arrays
|
||||
Globals:
|
||||
none
|
||||
Error:
|
||||
none
|
||||
Example:
|
||||
my ($pre_selected_ref, $pre_removed_ref) = xCAT::CFMUtils->getPreOSpkgsList($ospkglist);
|
||||
my @pre_selected = @$pre_selected_ref;
|
||||
my @pre_removed = @$pre_removed_ref;
|
||||
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
sub getPreOSpkgsList {
|
||||
my ($class, $pkglist) = @_;
|
||||
my @selected = ();
|
||||
my @removed = ();
|
||||
my @pkglistfiles = ();
|
||||
|
||||
# get the #INCLUDE file from cfmpkglist file
|
||||
my @incfiles = xCAT::CFMUtils->getIncludefiles($pkglist);
|
||||
foreach my $inc (@incfiles)
|
||||
{
|
||||
push @pkglistfiles, $inc;
|
||||
}
|
||||
# assume the #INCLUDE file includes the BASE packages
|
||||
push @pkglistfiles, $pkglist;
|
||||
|
||||
foreach my $file (@pkglistfiles)
|
||||
{
|
||||
my $pkglistfp;
|
||||
open($pkglistfp, xCAT::CFMUtils->trim($file));
|
||||
while (<$pkglistfp>)
|
||||
{
|
||||
my $line = xCAT::CFMUtils->trim($_);
|
||||
if (($line =~ /^#/) || ($line =~ /^\s*$/ ) || ($line =~ /^@/))
|
||||
{ #comment line or blank line
|
||||
next;
|
||||
} else
|
||||
{
|
||||
if ($line =~ /^-/)
|
||||
{ # the package be removed
|
||||
push @removed, substr($line, 1);
|
||||
} else
|
||||
{ # the package be installed
|
||||
push @selected, $line;
|
||||
}
|
||||
}
|
||||
}
|
||||
close($pkglistfp);
|
||||
}
|
||||
|
||||
# delete the removed packages from selected list
|
||||
my @intersection = xCAT::CFMUtils->arrayops("I", \@removed, \@selected);
|
||||
@selected = xCAT::CFMUtils->arrayops("D", \@selected, \@intersection);
|
||||
|
||||
return (\@selected, \@removed);
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 getPkgsDiff
|
||||
Get the differences between previous and current packages list
|
||||
|
||||
Arguments:
|
||||
@pre - previous selected packages list
|
||||
@cur - current selected packages list
|
||||
Returns:
|
||||
@diff - the differencen list
|
||||
Globals:
|
||||
none
|
||||
Error:
|
||||
none
|
||||
Example:
|
||||
my @diff = xCAT::CFMUtils->getPkgsDiff(\@pre_selected, \@cur_selected);
|
||||
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
sub getPkgsDiff {
|
||||
my ($class, $pre, $cur) = @_;
|
||||
|
||||
# get the intersection firstly
|
||||
my @tmp = xCAT::CFMUtils->arrayops("I", \@$pre, \@$cur);
|
||||
|
||||
# get the difference
|
||||
my @diff = xCAT::CFMUtils->arrayops("D", \@$pre, \@tmp);
|
||||
#print Dumper(@diff);
|
||||
|
||||
return @diff;
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 getIncludefiles
|
||||
Get the #INCLUDE files from the given file
|
||||
|
||||
Arguments:
|
||||
$file - the given file
|
||||
Returns:
|
||||
@files - the #INCLUDE files list
|
||||
Globals:
|
||||
none
|
||||
Error:
|
||||
none
|
||||
Example:
|
||||
my @diff = xCAT::CFMUtils->getIncludefiles($file);
|
||||
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
sub getIncludefiles {
|
||||
my ($class, $file) = @_;
|
||||
my @files = ();
|
||||
|
||||
my $fp;
|
||||
open($fp, $file);
|
||||
while (<$fp>)
|
||||
{
|
||||
my $line = xCAT::CFMUtils->trim($_);
|
||||
if ($line =~ /^\s*$/)
|
||||
{ # blank line
|
||||
next;
|
||||
}
|
||||
# find the #INCLUDE line
|
||||
if ($line =~ /^\s*#INCLUDE:[^#^\n]+#/)
|
||||
{
|
||||
#print "The line is: [$line]\n";
|
||||
my $incfile = substr($line, length("#INCLUDE:"), length($line)-length("#INCLUDE:")-1);
|
||||
push @files, $incfile;
|
||||
}
|
||||
}
|
||||
close($fp);
|
||||
|
||||
return @files;
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 trim
|
||||
Strip left and right whitspaces for a string
|
||||
|
||||
Arguments:
|
||||
$string
|
||||
Returns:
|
||||
@string
|
||||
Globals:
|
||||
none
|
||||
Error:
|
||||
none
|
||||
Example:
|
||||
my @new_string = xCAT::CFMUtils->trim($string);
|
||||
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
sub trim {
|
||||
my ($class, $string) = @_;
|
||||
|
||||
# trim the left whitespaces
|
||||
$string =~ s/^\s*//;
|
||||
|
||||
# trim the right whitespaces
|
||||
$string =~ s/\s*$//;
|
||||
|
||||
return $string;
|
||||
}
|
||||
|
||||
# Function: compute Union, Intersection or Difference of unique lists
|
||||
# Usage: arrayops ("U"/"I"/"D", @a, @b)
|
||||
# Return: @union/@intersection/@difference
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 arrayops
|
||||
Compute Union/Intersection/Difference for 2 unique lists
|
||||
|
||||
Arguments:
|
||||
$flag - "U"/"I"/"D"
|
||||
\@array1 - reference to an arrary
|
||||
\@array2 - reference to an arrary
|
||||
Returns:
|
||||
@union/@intersection/@difference
|
||||
Globals:
|
||||
none
|
||||
Error:
|
||||
none
|
||||
Example:
|
||||
my @array = xCAT::CFMUtils->arrayops(\@array1, \@array2);
|
||||
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
sub arrayops {
|
||||
my ($class, $ops, $array1, $array2) = @_;
|
||||
|
||||
my @union = ();
|
||||
my @intersection = ();
|
||||
my @difference = ();
|
||||
my %count = ();
|
||||
foreach my $element (@$array1, @$array2)
|
||||
{
|
||||
$count{$element}++
|
||||
}
|
||||
|
||||
foreach my $element (keys %count) {
|
||||
push @union, $element;
|
||||
push @{ $count{$element} > 1 ? \@intersection : \@difference }, $element;
|
||||
}
|
||||
|
||||
if ($ops eq "U") { return @union; }
|
||||
|
||||
if ($ops eq "I") { return @intersection; }
|
||||
|
||||
if ($ops eq "D") { return @difference; }
|
||||
|
||||
#return (\@union, \@intersection, \@difference);
|
||||
}
|
||||
+50
-99
@@ -9,7 +9,10 @@ BEGIN
|
||||
# if AIX - make sure we include perl 5.8.2 in INC path.
|
||||
# Needed to find perl dependencies shipped in deps tarball.
|
||||
if ($^O =~ /^aix/i) {
|
||||
unshift(@INC, qw(/usr/opt/perl5/lib/5.8.2/aix-thread-multi /usr/opt/perl5/lib/5.8.2 /usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi /usr/opt/perl5/lib/site_perl/5.8.2));
|
||||
use lib "/usr/opt/perl5/lib/5.8.2/aix-thread-multi";
|
||||
use lib "/usr/opt/perl5/lib/5.8.2";
|
||||
use lib "/usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi";
|
||||
use lib "/usr/opt/perl5/lib/site_perl/5.8.2";
|
||||
}
|
||||
|
||||
my $inet6support;
|
||||
@@ -24,15 +27,6 @@ if ($inet6support) {
|
||||
if ($inet6support) {
|
||||
$inet6support = eval { require IO::Socket::SSL; IO::Socket::SSL->import('inet6'); 1;};
|
||||
}
|
||||
|
||||
if ($^O =~ /^linux/i) {
|
||||
# Is IPv6 enabled on the MN or xcat client node at all?
|
||||
my $ipv6enabled = `ip addr | grep inet6`;
|
||||
if (!$ipv6enabled) {
|
||||
$inet6support = 0;
|
||||
}
|
||||
}
|
||||
|
||||
unless ($inet6support) {
|
||||
eval { require Socket };
|
||||
eval { require IO::Socket::INET };
|
||||
@@ -125,7 +119,7 @@ sub submit_request {
|
||||
unless ($cafile) { $cafile = $homedir."/.xcat/ca.pem"; }
|
||||
$xCAT::Client::EXITCODE = 0; # clear out exit code before invoking the plugin
|
||||
if (ref($request) eq 'HASH') { # the request is an array, not pure XML
|
||||
$request->{clienttype}->[0] = "cli"; # setup clienttype for auditlog
|
||||
$request->{clienttype}->[0] = "cli"; # setup clienttype for auditlog
|
||||
}
|
||||
# If XCATBYPASS is set, invoke the plugin process_request method directly
|
||||
# without going through the socket connection to the xcatd daemon
|
||||
@@ -135,7 +129,6 @@ if (ref($request) eq 'HASH') { # the request is an array, not pure XML
|
||||
if (!(defined($request->{username}))) {
|
||||
$request->{username}->[0] = getpwuid($>);
|
||||
}
|
||||
|
||||
# only allow root to run
|
||||
unless ($request->{username}->[0] =~ /root/) {
|
||||
print ("WARNING: Only allow root to run XCATBYPASS mode, your current user ID is $request->{username}->[0].\n");
|
||||
@@ -153,16 +146,14 @@ if (ref($request) eq 'HASH') { # the request is an array, not pure XML
|
||||
}
|
||||
} else {
|
||||
# figure out default plugins dir
|
||||
#my $sitetab=xCAT::Table->new('site');
|
||||
#unless ($sitetab) {
|
||||
# print ("ERROR: Unable to open basic site table for configuration\n");
|
||||
#}
|
||||
my $sitetab=xCAT::Table->new('site');
|
||||
unless ($sitetab) {
|
||||
print ("ERROR: Unable to open basic site table for configuration\n");
|
||||
}
|
||||
$plugins_dir=$::XCATROOT.'/lib/perl/xCAT_plugin';
|
||||
scan_plugins();
|
||||
}
|
||||
|
||||
populate_site_hash();
|
||||
|
||||
# don't do XML transformation -- assume request is well-formed
|
||||
# my $xmlreq=XMLout($request,RootName=>xcatrequest,NoAttr=>1,KeyAttr=>[]);
|
||||
# $request = XMLin($xmlreq,SuppressEmpty=>undef,ForceArray=>1) ;
|
||||
@@ -179,28 +170,11 @@ if (ref($request) eq 'HASH') { # the request is an array, not pure XML
|
||||
if ($ENV{XCATHOST}) {
|
||||
$xcathost=$ENV{XCATHOST};
|
||||
}
|
||||
my %connargs=();
|
||||
if ($xcathost =~ s/%([^\]|:]*)//) {
|
||||
$connargs{PeerScope} = $1;
|
||||
}
|
||||
$connargs{PeerAddr} = $xcathost;
|
||||
$connargs{Timeout} = 15;
|
||||
if ($connargs{PeerScope} and $connargs{PeerScope} =~ /[a-zA-Z]/) { #non-numeric, need to translate...
|
||||
my @ipdata = `ip link`;
|
||||
@ipdata = grep(/[^@]$connargs{PeerScope}(:|@)/,@ipdata);
|
||||
if (scalar(@ipdata) != 1) {
|
||||
print STDERR "Unable to identify scope ".$connargs{PeerScope}."\n";
|
||||
exit(1);
|
||||
}
|
||||
$connargs{PeerScope} = $ipdata[0];
|
||||
$connargs{PeerScope} =~ s/:.*//;
|
||||
}
|
||||
|
||||
|
||||
my $pclient;
|
||||
if ($inet6support) {
|
||||
$pclient = IO::Socket::INET6->new(
|
||||
%connargs,
|
||||
$pclient = IO::Socket::INET6->new(
|
||||
PeerAddr => $xcathost,
|
||||
Timeout => 15,
|
||||
);
|
||||
} else {
|
||||
$pclient = IO::Socket::INET->new(
|
||||
@@ -224,13 +198,23 @@ if (ref($request) eq 'HASH') { # the request is an array, not pure XML
|
||||
SSL_cert_file => $certfile,
|
||||
SSL_ca_file => $cafile,
|
||||
SSL_use_cert => 1,
|
||||
Timeout => 0,
|
||||
);
|
||||
Timeout => 0,
|
||||
);
|
||||
} else {
|
||||
$client = IO::Socket::SSL->start_SSL($pclient,
|
||||
Timeout => 0,
|
||||
);
|
||||
$client = IO::Socket::SSL->start_SSL($pclient,
|
||||
Timeout => 0,
|
||||
);
|
||||
}
|
||||
unless ($client) {
|
||||
print "Unable to open socket connection to xcatd daemon on $xcathost.\n";
|
||||
print "Verify that the xcatd daemon is running and that your SSL setup is correct.\n";
|
||||
if ($@ =~ /SSL Timeout/) {
|
||||
die "Connection failure: SSL Timeout or incorrect certificates in ~/.xcat";
|
||||
} else {
|
||||
die "Connection failure: $@"
|
||||
}
|
||||
}
|
||||
|
||||
my $msg;
|
||||
if (ref($request) eq 'HASH') { # the request is an array, not pure XML
|
||||
$msg=XMLout($request,RootName=>'xcatrequest',NoAttr=>1,KeyAttr=>[]);
|
||||
@@ -302,7 +286,6 @@ if (ref($request) eq 'HASH') { # the request is an array, not pure XML
|
||||
$massresponse="";
|
||||
unless ($cleanexit) {
|
||||
print STDERR "ERROR/WARNING: communication with the xCAT server seems to have been ended prematurely\n";
|
||||
$xCAT::Client::EXITCODE = 1;
|
||||
}
|
||||
|
||||
sub validateXML {
|
||||
@@ -390,6 +373,7 @@ sub plugin_command {
|
||||
my $callback = shift;
|
||||
my %handler_hash;
|
||||
my $usesiteglobal = 0;
|
||||
|
||||
# We require these only in bypass mode to reduce start up time for the normal case
|
||||
#use lib "$::XCATROOT/lib/perl";
|
||||
#use xCAT::NodeRange;
|
||||
@@ -423,6 +407,11 @@ sub plugin_command {
|
||||
unless (@nodes) {
|
||||
$req->{emptynoderange} = [1];
|
||||
}
|
||||
|
||||
if(@nodes == 0 ) {
|
||||
print "No nodes or noderanges specified\n";
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if (@nodes) { $req->{node} = \@nodes; }
|
||||
my %unhandled_nodes;
|
||||
@@ -440,18 +429,17 @@ sub plugin_command {
|
||||
if ($hdlspec =~ /^site:/) { #A site entry specifies a plugin
|
||||
my $sitekey = $hdlspec;
|
||||
$sitekey =~ s/^site://;
|
||||
#$sitetab = xCAT::Table->new('site');
|
||||
#my $sent = $sitetab->getAttribs({key=>$sitekey},['value']);
|
||||
#if ($sent and $sent->{value}) { #A site style plugin specification is just like
|
||||
if ($::XCATSITEVALS{$sitekey}) { #A site style plugin specification is just like
|
||||
$sitetab = xCAT::Table->new('site');
|
||||
my $sent = $sitetab->getAttribs({key=>$sitekey},['value']);
|
||||
if ($sent and $sent->{value}) { #A site style plugin specification is just like
|
||||
#a static global, it grabs all nodes rather than some
|
||||
$useglobals = -1; #If they tried to specify anything, don't use the default global handlers at all
|
||||
unless (@nodes) {
|
||||
$handler_hash{$::XCATSITEVALS{$sitekey}} = 1;
|
||||
$handler_hash{$sent->{value}} = 1;
|
||||
$usesiteglobal = 1;
|
||||
}
|
||||
foreach (@nodes) { #Specified a specific plugin, not a table lookup
|
||||
$handler_hash{$::XCATSITEVALS{$sitekey}}->{$_} = 1;
|
||||
$handler_hash{$sent->{value}}->{$_} = 1;
|
||||
}
|
||||
}
|
||||
} elsif ($hdlspec =~ /:/) { #Specificed a table lookup path for plugin name
|
||||
@@ -550,8 +538,7 @@ sub plugin_command {
|
||||
}
|
||||
} #Otherwise, global handler is implicitly disabled
|
||||
} else {
|
||||
print "Error request: $req->{command}->[0] has no known plugin for it.\n";
|
||||
return 1;
|
||||
return 1; #TODO: error back that request has no known plugin for it
|
||||
}
|
||||
if ($useunhandled) {
|
||||
my $queuelist;
|
||||
@@ -615,10 +602,7 @@ sub plugin_command {
|
||||
no strict "refs";
|
||||
# eval { #REMOVEEVALFORDEBUG
|
||||
# if ($dispatch_requests) {
|
||||
# backup the original req and recover it after the a run
|
||||
my $org_req = {%$req};
|
||||
dispatch_request($req,$callback,$modname);
|
||||
$req = {%$org_req};
|
||||
dispatch_request($req,$callback,$modname);
|
||||
# } else {
|
||||
# $SIG{CHLD}='DEFAULT';
|
||||
# ${"xCAT_plugin::".$modname."::"}{process_request}->($req,$callback,\&do_request);
|
||||
@@ -739,7 +723,7 @@ sub dispatch_request {
|
||||
if (ref $_->{'_xcatdest'} and (ref $_->{'_xcatdest'}) eq 'ARRAY') {
|
||||
_->{'_xcatdest'} = $_->{'_xcatdest'}->[0];
|
||||
}
|
||||
if ($onlyone and not ($_->{'_xcatdest'} and xCAT::NetworkUtils->thishostisnot($_->{'_xcatdest'}))) {
|
||||
if ($onlyone and not ($_->{'_xcatdest'} and xCAT::Utils->thishostisnot($_->{'_xcatdest'}))) {
|
||||
$SIG{CHLD}='DEFAULT';
|
||||
${"xCAT_plugin::".$modname."::"}{process_request}->($_,$dispatch_cb,\&do_request);
|
||||
return;
|
||||
@@ -780,7 +764,7 @@ sub dispatch_request {
|
||||
my $request_satisfied=0;
|
||||
foreach $xcatdest (@xcatdests) {
|
||||
my $dlock;
|
||||
if ($xcatdest and xCAT::NetworkUtils->thishostisnot($xcatdest)) {
|
||||
if ($xcatdest and xCAT::Utils->thishostisnot($xcatdest)) {
|
||||
#----- added to Client.pm -----#
|
||||
$dispatch_cb->({warning=>['XCATBYPASS is set, skipping hierarchy call to '.$_->{'_xcatdest'}.'']});
|
||||
#----- end added to Client.pm -----#
|
||||
@@ -911,28 +895,11 @@ sub build_response {
|
||||
|
||||
} # end of submit_request()
|
||||
|
||||
####################################
|
||||
# populates all the site attributes into %::XCATSITEVALS
|
||||
# This is used with XCATBYPASS=1
|
||||
###################################
|
||||
sub populate_site_hash {
|
||||
%::XCATSITEVALS=();
|
||||
my $sitetab = xCAT::Table->new('site',-create=>0);
|
||||
unless ($sitetab) {
|
||||
print ("ERROR: Unable to open basic site table for configuration\n");
|
||||
return;
|
||||
}
|
||||
my @records = $sitetab->getAllAttribs(qw/key value/);
|
||||
foreach (@records) {
|
||||
$::XCATSITEVALS{$_->{key}}=$_->{value};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
##########################################
|
||||
# handle_response is a default callback that can be passed into submit_request()
|
||||
# It is invoked repeatedly by submit_request() to print out the data returned by
|
||||
# handle_response is a default callback that can be passed into submit_response()
|
||||
# It is invoked repeatedly by submit_response() to print out the data returned by
|
||||
# the plugin.
|
||||
#
|
||||
# The normal flow is:
|
||||
@@ -1012,14 +979,14 @@ sub populate_site_hash {
|
||||
##########################################
|
||||
sub handle_response {
|
||||
my $rsp = shift;
|
||||
if ($ENV{'XCATSHOWXML'}) {
|
||||
if ($ENV{'XCATSHOWXML'}) {
|
||||
my $xmlrec=XMLout($rsp,RootName=>'xcatresponse',NoAttr=>1,KeyAttr=>[]);
|
||||
print "$xmlrec\n";
|
||||
return;
|
||||
}
|
||||
#print "in handle_response\n";
|
||||
# Handle errors
|
||||
if (defined($rsp->{errorcode})) {
|
||||
if ($rsp->{errorcode}) {
|
||||
if (ref($rsp->{errorcode}) eq 'ARRAY') {
|
||||
foreach my $ecode (@{$rsp->{errorcode}}) {
|
||||
$xCAT::Client::EXITCODE |= $ecode;
|
||||
@@ -1033,38 +1000,22 @@ sub handle_response {
|
||||
#print "printing error\n";
|
||||
if (ref($rsp->{error}) eq 'ARRAY') {
|
||||
foreach my $text (@{$rsp->{error}}) {
|
||||
if ($rsp->{NoErrorPrefix}) {
|
||||
print STDERR "$text\n";
|
||||
} else {
|
||||
print STDERR "Error: $text\n";
|
||||
}
|
||||
print STDERR "Error: $text\n";
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ($rsp->{NoErrorPrefix}) {
|
||||
print STDERR ($rsp->{error}."\n");
|
||||
} else {
|
||||
print STDERR ("Error: ".$rsp->{error}."\n");
|
||||
}
|
||||
print ("Error: ".$rsp->{error}."\n");
|
||||
}
|
||||
}
|
||||
if ($rsp->{warning}) {
|
||||
#print "printing warning\n";
|
||||
if (ref($rsp->{warning}) eq 'ARRAY') {
|
||||
foreach my $text (@{$rsp->{warning}}) {
|
||||
if ($rsp->{NoWarnPrefix}) {
|
||||
print STDERR "$text\n";
|
||||
} else {
|
||||
print STDERR "Warning: $text\n";
|
||||
}
|
||||
print STDERR "Warning: $text\n";
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ($rsp->{NoWarnPrefix}) {
|
||||
print STDERR ($rsp->{warning}."\n");
|
||||
} else {
|
||||
print STDERR ("Warning: ".$rsp->{warning}."\n");
|
||||
}
|
||||
print ("Warning: ".$rsp->{warning}."\n");
|
||||
}
|
||||
}
|
||||
if ($rsp->{info}) {
|
||||
|
||||
+13
-11
@@ -8,7 +8,6 @@ use File::stat;
|
||||
use File::Copy;
|
||||
use xCAT::Usage;
|
||||
use Thread qw/yield/;
|
||||
use Storable qw/store_fd fd_retrieve/;
|
||||
|
||||
BEGIN
|
||||
{
|
||||
@@ -30,18 +29,19 @@ sub forward_data {
|
||||
my $rfh;
|
||||
my $rc = @ready_fds;
|
||||
foreach $rfh (@ready_fds) {
|
||||
my $responses;
|
||||
eval {
|
||||
$responses = fd_retrieve($rfh);
|
||||
};
|
||||
if ($@ and $@ =~ /^Magic number checking on storable file/) { #this most likely means we ran over the end of available input
|
||||
$fds->remove($rfh);
|
||||
close($rfh);
|
||||
} else {
|
||||
my $data;
|
||||
if ($data = <$rfh>) {
|
||||
while ($data !~ /ENDOFFREEZE6sK4ci/) {
|
||||
$data .= <$rfh>;
|
||||
}
|
||||
eval { print $rfh "ACK\n"; }; #Ignore ack loss due to child giving up and exiting, we don't actually explicitly care about the acks
|
||||
my $responses=thaw($data);
|
||||
foreach (@$responses) {
|
||||
$callback->($_);
|
||||
}
|
||||
} else {
|
||||
$fds->remove($rfh);
|
||||
close($rfh);
|
||||
}
|
||||
}
|
||||
yield(); #Try to avoid useless iterations as much as possible
|
||||
@@ -62,7 +62,8 @@ sub send_data {
|
||||
foreach(@_) {
|
||||
my %output;
|
||||
if (ref($_) eq HASH) {
|
||||
store_fd([$_],$out);
|
||||
print $out freeze([$_]);
|
||||
print $out "\nENDOFFREEZE6sK4ci\n";
|
||||
yield();
|
||||
waitforack($out);
|
||||
next;
|
||||
@@ -96,7 +97,8 @@ sub send_data {
|
||||
} else {
|
||||
$output{node}->[0]->{data}->[0]->{contents}->[0]=$text;
|
||||
}
|
||||
store_fd([\%output],$out);
|
||||
print $out freeze([\%output]);
|
||||
print $out "\nENDOFFREEZE6sK4ci\n";
|
||||
yield();
|
||||
waitforack($out);
|
||||
}
|
||||
|
||||
+16
-231
@@ -16,7 +16,6 @@ require xCAT::Table;
|
||||
require xCAT::Utils;
|
||||
require xCAT::MsgUtils;
|
||||
require xCAT::NetworkUtils;
|
||||
require xCAT::ServiceNodeUtils;
|
||||
use strict;
|
||||
|
||||
# IPv6 not yet implemented - need Socket6
|
||||
@@ -57,7 +56,7 @@ sub getObjectsOfType
|
||||
|
||||
# The database may be changed between getObjectsOfType calls
|
||||
# do not use cache %::saveObjList if --nocache is specified
|
||||
if ($::saveObjList{$type} && !$::opt_nc)
|
||||
if ($::saveObjList{$type} && !$::opt_c)
|
||||
{
|
||||
@objlist = @{$::saveObjList{$type}};
|
||||
}
|
||||
@@ -200,8 +199,7 @@ sub getobjattrs
|
||||
# list of object names
|
||||
foreach my $table (keys %tableattrs) {
|
||||
# open the table
|
||||
# with autocommit => 0, it does not work on Ubuntu running mysql
|
||||
my $thistable = xCAT::Table->new($table, -create => 1, -autocommit => 1);
|
||||
my $thistable = xCAT::Table->new($table, -create => 1, -autocommit => 0);
|
||||
if (!$thistable) {
|
||||
my $rsp;
|
||||
$rsp->{data}->[0] = "Could not open the \'$table\' table.";
|
||||
@@ -397,44 +395,6 @@ sub getobjdefs
|
||||
xCAT::MsgUtils->message("E", $rsp, $::callback);
|
||||
}
|
||||
}
|
||||
} elsif (($objtype eq 'auditlog') || ($objtype eq 'eventlog')) {
|
||||
# Special case for auditlog/eventlog
|
||||
# All the auditlog/eventlog attributes are in auditlog/eventlog table,
|
||||
# Do not need to read the table multiple times for each attribute.
|
||||
# The auditlog/eventlog is likely be very big over time,
|
||||
# performance is a big concern with the general logic
|
||||
my @TableRowArray = xCAT::DBobjUtils->getDBtable($objtype);
|
||||
foreach my $objname (sort @{$type_obj{$objtype}}) {
|
||||
if (@TableRowArray)
|
||||
{
|
||||
my $foundinfo = 0;
|
||||
foreach my $entry (@TableRowArray)
|
||||
{
|
||||
if ($entry->{recid} eq $objname)
|
||||
{
|
||||
foreach my $k (keys %{$entry})
|
||||
{
|
||||
# recid is the object name, do not need to be in the attributes list
|
||||
if ($k eq 'recid') { next; }
|
||||
if (defined($entry->{$k}) ) {
|
||||
$foundinfo++;
|
||||
if ($verbose == 1) {
|
||||
$objhash{$objname}{$k} = "$entry->{$k}\t(Table:$objtype - Key:$k)";
|
||||
} else {
|
||||
$objhash{$objname}{$k} = $entry->{$k};
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($foundinfo)
|
||||
{
|
||||
$objhash{$objname}{'objtype'} = $objtype;
|
||||
}
|
||||
# There should not be multiple entries with the same recid
|
||||
last;
|
||||
} # end if($entry->
|
||||
} # end foreach my $entry
|
||||
} # end if(@TableTowArray
|
||||
} # end foreach my $objname
|
||||
} else {
|
||||
# get the object type decription from Schema.pm
|
||||
my $datatype = $xCAT::Schema::defspec{$objtype};
|
||||
@@ -607,7 +567,7 @@ sub getDBtable
|
||||
|
||||
# save this table info - in case this subr gets called multiple times
|
||||
# --nocache flag specifies not to use cahe
|
||||
if (grep(/^$table$/, @::foundTableList) && !$::opt_nc)
|
||||
if (grep(/^$table$/, @::foundTableList) && !$::opt_c)
|
||||
{
|
||||
|
||||
# already have this
|
||||
@@ -1163,7 +1123,7 @@ sub setobjdefs
|
||||
xCAT::MsgUtils->message("W", $rsp, $::callback);
|
||||
} else {
|
||||
my $rsp;
|
||||
$rsp->{data}->[0] = "$em is not in the attribute of \'$attr_name\' for the \'$objname\' definition.";
|
||||
$rsp->{data}->[0] = "$em is not in the atrribute of \'$attr_name\' for the \'$objname\' definition.";
|
||||
xCAT::MsgUtils->message("W", $rsp, $::callback);
|
||||
}
|
||||
}
|
||||
@@ -1680,14 +1640,7 @@ sub readFileInput
|
||||
|
||||
$look_for_colon = 0; # ok - we have a colon
|
||||
|
||||
# Remove any trailing whitespace
|
||||
$l =~ s/\s*$//;
|
||||
|
||||
# IPv6 network names could be something like fd59::/64
|
||||
# Use all the characters before the last ":" as the object name
|
||||
# .* means greedy regular expression
|
||||
$l =~ /^(.*):(.*?)$/;
|
||||
($objectname, $junk2) = ($1, $2);
|
||||
($objectname, $junk2) = split(/:/, $l);
|
||||
|
||||
# if $junk2 is defined or there's an =
|
||||
if ($junk2 || grep(/=/, $objectname))
|
||||
@@ -2003,11 +1956,15 @@ sub getNetwkInfo
|
||||
if (xCAT::Utils->isMN() && !$nethash{$node}{'gateway'})
|
||||
{
|
||||
# does not have ip address in this subnet,
|
||||
# use the node attribute 'xcatmaster' or site.master
|
||||
my @nodes = ("$node");
|
||||
my $sn = xCAT::ServiceNodeUtils->get_ServiceNode(\@nodes,"xcat","Node");
|
||||
my $snkey = (keys %{$sn})[0];
|
||||
$nethash{$node}{'gateway'} = xCAT::NetworkUtils->getipaddr($snkey);
|
||||
# use the node attribute 'xcatmaster'
|
||||
my $noderestab = xCAT::Table->new('noderes');
|
||||
my $et = $noderestab->getNodeAttribs($node, ['xcatmaster']);
|
||||
if ($et and defined($et->{'xcatmaster'}))
|
||||
{
|
||||
my $value = $et->{'xcatmaster'};
|
||||
$nethash{$node}{'gateway'} = xCAT::NetworkUtils->getipaddr($value);
|
||||
}
|
||||
$noderestab->close();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2158,7 +2115,7 @@ sub getchildren
|
||||
$::RUNCMD_RC = 1;
|
||||
return undef;
|
||||
}
|
||||
my @ps = $ppctab->getAllNodeAttribs(['node','parent','nodetype','hcp']);
|
||||
my @ps = $ppctab->getAllNodeAttribs(['node','parent','nodetype']);
|
||||
foreach my $entry ( @ps ) {
|
||||
my $p = $entry->{parent};
|
||||
my $c = $entry->{node};
|
||||
@@ -2169,19 +2126,13 @@ sub getchildren
|
||||
# build hash of ppc.parent -> ppc.node
|
||||
push @{$PPCHASH{$p}}, $c;
|
||||
}
|
||||
elsif ($t eq 'blade') {
|
||||
push @{$PPCHASH{$c}}, $entry->{hcp};
|
||||
}
|
||||
} else { # go look in the nodetype table to find nodetype
|
||||
my $type = getnodetype($c, "ppc");
|
||||
my $type = getnodetype($c);
|
||||
if ( $type eq 'fsp' or $type eq 'bpa')
|
||||
{
|
||||
# build hash of ppc.parent -> ppc.node
|
||||
push @{$PPCHASH{$p}}, $c;
|
||||
}
|
||||
elsif ($type eq "blade") {
|
||||
push @{$PPCHASH{$c}}, $entry->{hcp};
|
||||
}
|
||||
}
|
||||
} # not $p and $c
|
||||
}
|
||||
@@ -2606,170 +2557,4 @@ sub judge_node
|
||||
|
||||
return $flag;
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 expandnicsattr
|
||||
Expand the nics related attributes into the readable format,
|
||||
for example, the nicsips=eth0!1.1.1.1|2.1.1.1,eth1!3.1.1.1|4.1.1.1
|
||||
expanded format:
|
||||
nicsips.eth0=1.1.1.1|2.1.1.1
|
||||
nicsips.eth1=3.1.1.1|4.1.1.1
|
||||
|
||||
Arguments:
|
||||
nicsattr value, like niccsips=eth0!1.1.1.1|2.1.1.1,eth1!3.1.1.1|4.1.1.1
|
||||
nicnames: only return the value for specific nics, like "eth0,eth1"
|
||||
Returns:
|
||||
expanded format, like:
|
||||
nicsips.eth0=1.1.1.1|2.1.1.1
|
||||
nicsips.eth1=3.1.1.1|4.1.1.1
|
||||
Error:
|
||||
none
|
||||
|
||||
Example:
|
||||
my $nicsstr = xCAT::DBobjUtils->expandnicsattr($attrval);
|
||||
|
||||
Comments:
|
||||
none
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
sub expandnicsattr()
|
||||
{
|
||||
my $nicstr = shift;
|
||||
if (($nicstr) && ($nicstr =~ /xCAT::/))
|
||||
{
|
||||
$nicstr = shift;
|
||||
}
|
||||
my $nicnames = shift;
|
||||
|
||||
my $ret;
|
||||
|
||||
$nicstr =~ /^(.*?)=(.*?)$/;
|
||||
|
||||
#Attribute: nicips, nichostnamesuffix, etc.
|
||||
my $nicattr = $1;
|
||||
|
||||
# Value: eth0!1.1.1.1|2.1.1.1,eth1!3.1.1.1|4.1.1.1
|
||||
my $nicval=$2;
|
||||
|
||||
# $nicarr[0]: eth0!1.1.1.1|2.1.1.1
|
||||
# $nicarr[1]: eth1!3.1.1.1|4.1.1.1
|
||||
my @nicarr = split(/,/, $nicval);
|
||||
|
||||
foreach my $nicentry (@nicarr)
|
||||
{
|
||||
#nicentry: eth0!1.1.1.1|2.1.1.1
|
||||
# $nicv[0]: eth0
|
||||
# $nicv[1]: 1.1.1.1|2.1.1.1
|
||||
my @nicv = split(/!/, $nicentry);
|
||||
|
||||
# only return nic* attr for these specific nics
|
||||
if ($nicnames)
|
||||
{
|
||||
my @nics = split(/,/, $nicnames);
|
||||
if ($nicv[0])
|
||||
{
|
||||
# Do not need to return the nic attr for this nic
|
||||
if (!grep(/^$nicv[0]$/, @nics))
|
||||
{
|
||||
next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# ignore the line that does not have nicname or value
|
||||
if ($nicv[0] && $nicv[1])
|
||||
{
|
||||
$ret .= " $nicattr.$nicv[0]=$nicv[1]\n";
|
||||
}
|
||||
}
|
||||
|
||||
chomp($ret);
|
||||
return $ret;
|
||||
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 collapsenicsattr
|
||||
Collapse the nics related attributes into the database format,
|
||||
for example,
|
||||
nicsips.eth0=1.1.1.1|2.1.1.1
|
||||
nicsips.eth1=3.1.1.1|4.1.1.1
|
||||
|
||||
the collapsed format:
|
||||
nicsips=eth0!1.1.1.1|2.1.1.1,eth1!3.1.1.1|4.1.1.1
|
||||
|
||||
The collapse will be done against the hash %::FILEATTRS or %::CLIATTRS,
|
||||
remove the nicips.thx attributes from %::FILEATTRS or %::CLIATTRS,
|
||||
add the collapsed info nicips into %::FILEATTRS or %::CLIATTRS.
|
||||
|
||||
Arguments:
|
||||
$::FILEATTRS{$objname} or $::CLIATTRS{$objname}
|
||||
$objname
|
||||
|
||||
Returns:
|
||||
None, update %::FILEATTRS or %::CLIATTRS directly
|
||||
|
||||
Error:
|
||||
none
|
||||
|
||||
Example:
|
||||
xCAT::DBobjUtils->collapsenicsattr($nodeattrhash);
|
||||
|
||||
Comments:
|
||||
none
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
sub collapsenicsattr()
|
||||
{
|
||||
my $nodeattrhash = shift;
|
||||
if (($nodeattrhash) && ($nodeattrhash =~ /xCAT::/))
|
||||
{
|
||||
$nodeattrhash = shift;
|
||||
}
|
||||
my $objname = shift;
|
||||
|
||||
my %nicattrs = ();
|
||||
foreach my $nodeattr (keys %{$nodeattrhash})
|
||||
{
|
||||
# e.g nicips.eth0
|
||||
# do not need to handle nic attributes without the postfix .ethx,
|
||||
# it will be overwritten by the attributes with the postfix .ethx,
|
||||
if ($nodeattr =~ /^(nic\w+)\.(\w+)$/)
|
||||
{
|
||||
if ($1 && $2)
|
||||
{
|
||||
# chdef <noderange> nicips.eth2= to remove the definition for eth2
|
||||
# in this case, the $nodeattrhash->{'nicips.eth0'} is blank
|
||||
if ($nodeattrhash->{$nodeattr})
|
||||
{
|
||||
# $nicattrs{nicips}{eth0} = "1.1.1.1|1.2.1.1"
|
||||
$nicattrs{$1}{$2} = $nodeattrhash->{$nodeattr};
|
||||
}
|
||||
|
||||
# remove nicips.eth0 from the %::FILEATTRS
|
||||
delete $nodeattrhash->{$nodeattr};
|
||||
}
|
||||
}
|
||||
}
|
||||
# $nicattrs{'nicips'}{'eth0'} = "1.1.1.1|1.2.1.1"
|
||||
# $nicattrs{'nicips'}{'eth1'} = "2.1.1.1|2.2.1.1"
|
||||
foreach my $nicattr (keys %nicattrs)
|
||||
{
|
||||
my @tmparray = ();
|
||||
foreach my $nicname (keys %{$nicattrs{$nicattr}})
|
||||
{
|
||||
# eth0!1.1.1.1|1.2.1.1
|
||||
push @tmparray, "$nicname!$nicattrs{$nicattr}{$nicname}";
|
||||
}
|
||||
# eth0!1.1.1.1|1.2.1.1,eth1!2.1.1.1|2.2.1.1
|
||||
$nodeattrhash->{$nicattr} = join(',', @tmparray);
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
+361
-1513
File diff suppressed because it is too large
Load Diff
+53
-110
@@ -159,100 +159,6 @@ no strict;
|
||||
use strict;
|
||||
}
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
=head3
|
||||
fork_output_for_commands
|
||||
|
||||
Forks a process for the given command array and returns the process
|
||||
ID for the forked process and references to all I/O pipes for STDOUT
|
||||
and STDERR. In the child process, it will invoke the xCAT::DSHCore->fork_no_output()
|
||||
for the first command which is a no-output command and waitpid(). And then execute
|
||||
the left commands in the child process.
|
||||
|
||||
Arguments:
|
||||
$fork_id - unique identifer to use for tracking the forked process
|
||||
@command - command and parameter array to execute in the forkec process
|
||||
|
||||
Returns:
|
||||
$pid - process identifer for the forked process
|
||||
|
||||
Globals:
|
||||
None
|
||||
|
||||
Error:
|
||||
None
|
||||
|
||||
Example:
|
||||
$pid = xCAT::DSHCore->fork_output_for_commands('hostname1PID', @command_array);
|
||||
|
||||
Comments:
|
||||
|
||||
=cut
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
|
||||
sub fork_output_for_commands
|
||||
{
|
||||
my ($class, $fork_id, @commands) = @_;
|
||||
no strict;
|
||||
my $pid;
|
||||
my %pipes = ();
|
||||
|
||||
my $rout_fh = "rout_$fork_id";
|
||||
my $rerr_fh = "rerr_$fork_id";
|
||||
my $wout_fh = "wout_$fork_id";
|
||||
my $werr_fh = "werr_$fork_id";
|
||||
|
||||
(pipe($rout_fh, $wout_fh) == -1) && return (-1, undef);
|
||||
(pipe($rerr_fh, $werr_fh) == -1) && return (-2, undef);
|
||||
|
||||
if ($pid = fork)
|
||||
{
|
||||
close($wout_fh);
|
||||
close($werr_fh);
|
||||
}
|
||||
|
||||
elsif (defined $pid)
|
||||
{
|
||||
close($rout_fh);
|
||||
close($rerr_fh);
|
||||
|
||||
!(open(STDOUT, ">&$wout_fh")) && return (-5, undef);
|
||||
!(open(STDERR, ">&$werr_fh")) && return (-6, undef);
|
||||
|
||||
select(STDOUT);
|
||||
$| = 1;
|
||||
select(STDERR);
|
||||
$| = 1;
|
||||
if ( @commands > 1 ) {
|
||||
my $command0 = shift(@commands);
|
||||
my @exe_command0_process = xCAT::DSHCore->fork_no_output($fork_id, @$command0);
|
||||
waitpid($exe_command0_process[0], undef);
|
||||
}
|
||||
|
||||
my $t_command = shift(@commands);
|
||||
my @command = @$t_command;
|
||||
if (!(exec {$command[0]} @command))
|
||||
{
|
||||
return (-4, undef);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return (-3, undef);
|
||||
}
|
||||
|
||||
return ($pid, *$rout_fh, *$rerr_fh, *$wout_fh, *$werr_fh);
|
||||
use strict;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
=head3
|
||||
@@ -490,7 +396,7 @@ sub pipe_handler
|
||||
|| print STDOUT
|
||||
"dsh> Error_file_closed $$target_properties{hostname} $output_file\n";
|
||||
my $rsp={};
|
||||
$rsp->{error}->[0] =
|
||||
$rsp->{data}->[0] =
|
||||
"Error_file_closed $$target_properties{hostname $output_file}.\n";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
|
||||
($output_file == $$target_properties{'output-fh'})
|
||||
@@ -669,6 +575,55 @@ sub pipe_handler_buffer
|
||||
return $eof_reached;
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
=head3
|
||||
fping_hostnames
|
||||
|
||||
Executes fping on a given list of hostnames and returns a list of those
|
||||
hostnames that did not respond
|
||||
|
||||
Arguments:
|
||||
@hostnames - list of hostnames to execute for fping
|
||||
|
||||
Returns:
|
||||
@no_response - list of hostnames that did not respond
|
||||
undef if fping is not installed
|
||||
|
||||
Globals:
|
||||
None
|
||||
|
||||
Error:
|
||||
None
|
||||
|
||||
Example:
|
||||
@bad_hosts = xCAT::DSHCore->fping_hostnames(@host_list);
|
||||
|
||||
Comments:
|
||||
|
||||
=cut
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
sub fping_hostnames
|
||||
{
|
||||
my ($class, @hostnames) = @_;
|
||||
|
||||
my $fping = (-x '/usr/sbin/fping') || undef;
|
||||
!$fping && return undef;
|
||||
|
||||
my @output = `/usr/sbin/fping -B 1.0 -r 1 -t 50 -i 10 -p 50 @hostnames`;
|
||||
|
||||
my @no_response = ();
|
||||
foreach my $line (@output)
|
||||
{
|
||||
my ($hostname, $token, $status) = split ' ', $line;
|
||||
!(($token eq 'is') && ($status eq 'alive'))
|
||||
&& (push @no_response, $hostname);
|
||||
}
|
||||
|
||||
return @no_response;
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
@@ -754,24 +709,12 @@ sub pping_hostnames
|
||||
my ($class, @hostnames) = @_;
|
||||
|
||||
my $hostname_list = join ",", @hostnames;
|
||||
# read site table, usefping attribute
|
||||
# if set then run pping -f to use fping
|
||||
# this fixes a broken nmap in Redhat 6.2 with ip alias (3512)
|
||||
my $cmd="$::XCATROOT/bin/pping $hostname_list"; # default
|
||||
my @usefping=xCAT::TableUtils->get_site_attribute("usefping");
|
||||
if ((defined($usefping[0])) && ($usefping[0] eq "1")) {
|
||||
$cmd = "$::XCATROOT/bin/pping -f $hostname_list";
|
||||
}
|
||||
#my $rsp={};
|
||||
#$rsp->{data}->[0] = "running command $cmd";
|
||||
#xCAT::MsgUtils->message("I", $rsp, $::CALLBACK);
|
||||
|
||||
my @output =
|
||||
xCAT::Utils->runcmd($cmd, -1);
|
||||
xCAT::Utils->runcmd("$::XCATROOT/bin/pping $hostname_list", -1);
|
||||
if ($::RUNCMD_RC !=0) {
|
||||
my $rsp={};
|
||||
$rsp->{error}->[0] = "Error from pping";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
|
||||
$rsp->{data}->[0] = "Error from pping";
|
||||
xCAT::MsgUtils->message("I", $rsp, $::CALLBACK);
|
||||
}
|
||||
$::RUNCMD_RC =0; # reset
|
||||
my @no_response = ();
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
#!/usr/bin/env perl
|
||||
# IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
package xCAT::DiscoveryUtils;
|
||||
|
||||
use strict;
|
||||
use XML::Simple;
|
||||
$XML::Simple::PREFERRED_PARSER='XML::Parser';
|
||||
|
||||
use xCAT::MsgUtils;
|
||||
|
||||
=head3 update_discovery_data
|
||||
Update the discovery data from the xcat request to discoverydata table to indicate the discovery events
|
||||
arg1 - the request
|
||||
|
||||
=cut
|
||||
|
||||
sub update_discovery_data {
|
||||
my $class = shift;
|
||||
my $request = shift;
|
||||
|
||||
my %disdata;
|
||||
my %otherdata;
|
||||
|
||||
unless ($request->{'uuid'}->[0]) {
|
||||
xCAT::MsgUtils->message("S", "Discovery Error: Found a node without uuid");
|
||||
}
|
||||
|
||||
if ($request->{'discoverymethod'}->[0]) {
|
||||
$disdata{'method'} = $request->{'discoverymethod'}->[0];
|
||||
} else {
|
||||
$disdata{'method'} = "undef";
|
||||
}
|
||||
|
||||
#discoverytime
|
||||
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time);
|
||||
my $currtime = sprintf("%02d-%02d-%04d %02d:%02d:%02d",
|
||||
$mon + 1, $mday, $year + 1900, $hour, $min, $sec);
|
||||
$disdata{'discoverytime'} = $currtime;
|
||||
|
||||
foreach my $attr (keys %$request) {
|
||||
if ($attr =~ /^(command|discoverymethod|_xcat|cacheonly|noderange|environment|method|discoverytime|updateswitch)/) {
|
||||
next;
|
||||
} elsif ($attr =~ /^(node|uuid|arch|cpucount|cputype|memory|mtm|serial)$/) {
|
||||
$disdata{$attr} = $request->{$attr}->[0];
|
||||
} elsif ($attr eq 'nic') {
|
||||
# Set the nics attributes
|
||||
foreach my $nic (@{$request->{nic}}) {
|
||||
my $nicname = $nic->{'devname'}->[0];
|
||||
foreach my $nicattr (keys %$nic) {
|
||||
my $tbattr;
|
||||
if ($nicattr eq 'driver') {
|
||||
$tbattr = "nicdriver";
|
||||
} elsif ($nicattr eq 'ip4address') {
|
||||
$tbattr = "nicipv4";
|
||||
} elsif ($nicattr eq 'hwaddr') {
|
||||
$tbattr = "nichwaddr";
|
||||
} elsif ($nicattr eq 'pcidev') {
|
||||
$tbattr = "nicpci";
|
||||
} elsif ($nicattr eq 'location') {
|
||||
$tbattr = "nicloc";
|
||||
} elsif ($nicattr eq 'onboardeth') {
|
||||
$tbattr = "niconboard";
|
||||
} elsif ($nicattr eq 'firmdesc') {
|
||||
$tbattr = "nicfirm";
|
||||
} elsif ($nicattr =~ /^(switchname|switchaddr|switchdesc|switchport)$/) {
|
||||
$tbattr = $nicattr;
|
||||
}
|
||||
|
||||
if ($tbattr) {
|
||||
if ($disdata{$tbattr}) {
|
||||
$disdata{$tbattr} .= ','.$nicname.'!'.$nic->{$nicattr}->[0];
|
||||
} else {
|
||||
$disdata{$tbattr} = $nicname.'!'.$nic->{$nicattr}->[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
# store to otherdata for the not parsed attributes
|
||||
$otherdata{$attr} = $request->{$attr};
|
||||
}
|
||||
}
|
||||
|
||||
if (keys %otherdata) {
|
||||
$disdata{'otherdata'} = XMLout(\%otherdata,RootName=>'discoveryotherdata' ,NoAttr=>1);
|
||||
}
|
||||
|
||||
my $distab = xCAT::Table->new('discoverydata');
|
||||
if ($distab) {
|
||||
$distab->setAttribs({uuid=>$request->{'uuid'}->[0]},\%disdata);
|
||||
$distab->close();
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -35,7 +35,7 @@ foreach (@extSchema) {
|
||||
if ($@) {
|
||||
$warning ="Warning: The user defined database table schema file $file cannot be located or has compiling errors.\n";
|
||||
print $warning;
|
||||
`logger -p local4.warning -t xCAT $warning`;
|
||||
`logger -t xCAT $warning`;
|
||||
next;
|
||||
}
|
||||
if (${"xCAT_schema::" . "$modname" . "::"}{tabspec}) {
|
||||
@@ -44,7 +44,7 @@ foreach (@extSchema) {
|
||||
if (exists($ext_tabspec{$tabname})) {
|
||||
$warning = "Warning: File $file: the table name $tabname is used by other applications. Please rename the table.\n";
|
||||
print $warning;
|
||||
`logger -p local4.warning -t xCAT $warning`;
|
||||
`logger -t xCAT $warning`;
|
||||
} else {
|
||||
$ext_tabspec{$tabname}=$tabspec{$tabname};
|
||||
}
|
||||
@@ -52,7 +52,7 @@ foreach (@extSchema) {
|
||||
} else {
|
||||
$warning ="\n Warning: Cannot find \%tabspec variable in the user defined database table schema file $file\n";
|
||||
print $warning;
|
||||
`logger -p local4.warning -t xCAT $warning`;
|
||||
`logger -t xCAT $warning`;
|
||||
}
|
||||
|
||||
#get the defspec from each file and merge them into %ext_defspec
|
||||
@@ -74,7 +74,7 @@ foreach (@extSchema) {
|
||||
if (exists($tmp_hash{$attrname})) {
|
||||
$warning= " Warning: Conflict when adding user defined defspec from file $file. Attribute name $attrname is already defined in object $objname. \n";
|
||||
print $warning;
|
||||
`logger -p local4.warning -t xCAT $warning`;
|
||||
`logger -t xCAT $warning`;
|
||||
} else {
|
||||
#print "\ngot here objname=$objname, attrname=" . $h->{attr_name} . "\n";
|
||||
push(@{$ext_defspec{$objname}->{'attrs'}}, $h);
|
||||
|
||||
+11
-20
@@ -10,7 +10,10 @@ BEGIN
|
||||
# if AIX - make sure we include perl 5.8.2 in INC path.
|
||||
# Needed to find perl dependencies shipped in deps tarball.
|
||||
if ($^O =~ /^aix/i) {
|
||||
unshift(@INC, qw(/usr/opt/perl5/lib/5.8.2/aix-thread-multi /usr/opt/perl5/lib/5.8.2 /usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi /usr/opt/perl5/lib/site_perl/5.8.2));
|
||||
use lib "/usr/opt/perl5/lib/5.8.2/aix-thread-multi";
|
||||
use lib "/usr/opt/perl5/lib/5.8.2";
|
||||
use lib "/usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi";
|
||||
use lib "/usr/opt/perl5/lib/site_perl/5.8.2";
|
||||
}
|
||||
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
@@ -23,10 +26,9 @@ require xCAT::InstUtils;
|
||||
require xCAT::NetworkUtils;
|
||||
require xCAT::Schema;
|
||||
require xCAT::Utils;
|
||||
require xCAT::TableUtils;
|
||||
#use Data::Dumper;
|
||||
require xCAT::NodeRange;
|
||||
use xCAT::MsgUtils qw(verbose_message);
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
@@ -67,7 +69,7 @@ sub getHcpAttribs
|
||||
}
|
||||
}
|
||||
|
||||
my @ps = $tabs->{ppc}->getAllNodeAttribs(['node','parent','nodetype','hcp']);
|
||||
my @ps = $tabs->{ppc}->getAllNodeAttribs(['node','parent','nodetype']);
|
||||
for my $entry ( @ps ) {
|
||||
my $tmp_parent = $entry->{parent};
|
||||
my $tmp_node = $entry->{node};
|
||||
@@ -76,9 +78,6 @@ sub getHcpAttribs
|
||||
push @{$ppchash{$tmp_parent}{children}}, $tmp_node;
|
||||
#push @{$ppchash{$tmp_parent}}, $tmp_node;
|
||||
}
|
||||
if (defined($tmp_node) && defined($tmp_type) && ($tmp_type eq "blade") && defined($entry->{hcp})) {
|
||||
push @{$ppchash{$tmp_node}{children}}, $entry->{hcp};
|
||||
}
|
||||
|
||||
#if(exists($ppchash{$tmp_node})) {
|
||||
# if( defined($tmp_type) ) {
|
||||
@@ -134,7 +133,7 @@ sub getIPaddress
|
||||
my $type = shift;
|
||||
my $nodetocheck = shift;
|
||||
my $port = shift;
|
||||
if (xCAT::NetworkUtils::isIpaddr($nodetocheck)) {
|
||||
if (xCAT::Utils::isIpaddr($nodetocheck)) {
|
||||
return $nodetocheck;
|
||||
}
|
||||
my $side = "[A|B]";
|
||||
@@ -176,8 +175,6 @@ sub getIPaddress
|
||||
#the $nodetocheck is its' hcp. So set $nodetocheck to $parent variable.
|
||||
#And then get the FSPs IPs for the CEC.
|
||||
$parent = $nodetocheck;
|
||||
} elsif ($type eq "blade") {
|
||||
return $ppc->{$nodetocheck}->{children}->[0];
|
||||
} else {
|
||||
return undef;
|
||||
}
|
||||
@@ -194,7 +191,7 @@ sub getIPaddress
|
||||
if ($tmp_s and $tmp_s =~ /^$side-$port$/i) {
|
||||
$tmp_s =~ s/a/A/;
|
||||
$tmp_s =~ s/b/B/;
|
||||
if (xCAT::NetworkUtils::isIpaddr($tmp_n)) {
|
||||
if (xCAT::Utils::isIpaddr($tmp_n)) {
|
||||
$node_side_pairs{$tmp_s} = $tmp_n;
|
||||
$children_num++;
|
||||
} else {
|
||||
@@ -288,7 +285,6 @@ sub fsp_api_action {
|
||||
}
|
||||
$id = $$attrs[0];
|
||||
$fsp_name = $$attrs[3];
|
||||
xCAT::MsgUtils->verbose_message($request, "fsp_api_action START node:$node_name,type:$$attrs[4].");
|
||||
if($$attrs[4] =~ /^fsp$/ || $$attrs[4] =~ /^lpar$/ || $$attrs[4] =~ /^cec$/) {
|
||||
$type = 0;
|
||||
$fsp_bpa_type="fsp";
|
||||
@@ -311,7 +307,7 @@ sub fsp_api_action {
|
||||
} else {
|
||||
$fsp_ip = getIPaddress($request, $$attrs[4], $fsp_name );
|
||||
}
|
||||
xCAT::MsgUtils->verbose_message($request, "fsp_api_action getIPaddress:$fsp_ip.");
|
||||
|
||||
if(!defined($fsp_ip)) {
|
||||
$res = "Failed to get IP address for $fsp_name or the related FSPs/BPAs.";
|
||||
return ([$node_name, $res, -1]);
|
||||
@@ -352,7 +348,7 @@ sub fsp_api_action {
|
||||
}
|
||||
|
||||
my $cmd;
|
||||
my $install_dir = xCAT::TableUtils->getInstallDir();
|
||||
my $install_dir = xCAT::Utils->getInstallDir();
|
||||
if( $action =~ /^(code_update|get_compatible_version_from_rpm)$/) {
|
||||
$cmd = "$fsp_api -a $action -T $tooltype -t $type:$fsp_ip:$id:$node_name:$parameter -d $install_dir/packages_fw/";
|
||||
} elsif($action =~ /^code_updateD$/) {
|
||||
@@ -375,7 +371,7 @@ sub fsp_api_action {
|
||||
$cmd = "$fsp_api -a $action -T $tooltype -t $type:$fsp_ip:$id:$node_name:";
|
||||
}
|
||||
}
|
||||
xCAT::MsgUtils->verbose_message($request, "fsp_api_action cmd:$cmd.");
|
||||
|
||||
#print "cmd: $cmd\n";
|
||||
$SIG{CHLD} = 'DEFAULT';
|
||||
# secure passwords in verbose mode
|
||||
@@ -397,7 +393,6 @@ sub fsp_api_action {
|
||||
if(defined($res)) {
|
||||
$res =~ s/$node_name: //g;
|
||||
}
|
||||
xCAT::MsgUtils->verbose_message($request, "fsp_api_action return:$Rc.");
|
||||
return( [$node_name,$res, $Rc] );
|
||||
}
|
||||
|
||||
@@ -449,7 +444,6 @@ sub fsp_state_action {
|
||||
$fsp_name = $node_name;
|
||||
|
||||
|
||||
xCAT::MsgUtils->verbose_message($request, "fsp_state_action START node:$node_name,type:$$attrs[4].");
|
||||
if( $$attrs[4] =~ /^(fsp|lpar|cec|blade)$/) {
|
||||
$type = 0;
|
||||
} else {
|
||||
@@ -465,13 +459,11 @@ sub fsp_state_action {
|
||||
return ([-1, $res[0]]);
|
||||
}
|
||||
|
||||
xCAT::MsgUtils->verbose_message($request, "fsp_state_action getIPaddress:$fsp_ip.");
|
||||
#print "fsp name: $fsp_name\n";
|
||||
#print "fsp ip: $fsp_ip\n";
|
||||
my $cmd;
|
||||
#$cmd = "$fsp_api -a $action -u $user -p $password -T $tooltype -t $type:$fsp_ip:$id:$node_name:";
|
||||
$cmd = "$fsp_api -a $action -T $tooltype -t $type:$fsp_ip:$id:$node_name:";
|
||||
xCAT::MsgUtils->verbose_message($request, "fsp_state_action cmd:$cmd.");
|
||||
#print "cmd: $cmd\n";
|
||||
$SIG{CHLD} = 'DEFAULT';
|
||||
@res = xCAT::Utils->runcmd($cmd, -1);
|
||||
@@ -485,7 +477,6 @@ sub fsp_state_action {
|
||||
if( @res ) {
|
||||
$res[0] =~ s/$node_name: //g;
|
||||
}
|
||||
xCAT::MsgUtils->verbose_message($request, "fsp_state_action return:$Rc.");
|
||||
return( [$Rc,@res] );
|
||||
}
|
||||
|
||||
|
||||
@@ -215,7 +215,7 @@ sub rnetboot {
|
||||
my $options = $request->{opt};
|
||||
my $hwtype = @$exp[2];
|
||||
my $result;
|
||||
my $name = $request->{node};
|
||||
my $name;
|
||||
my $callback = $request->{callback};
|
||||
#####################################
|
||||
# Get node data
|
||||
@@ -238,13 +238,6 @@ sub rnetboot {
|
||||
C => $o->{client},
|
||||
m => $o->{mac}
|
||||
);
|
||||
#####################################
|
||||
# Parse node range
|
||||
#####################################
|
||||
if ($name =~ /ARRAY/) {
|
||||
$name = join(',', @$name);
|
||||
}
|
||||
|
||||
#####################################
|
||||
# Strip colons from mac address
|
||||
#####################################
|
||||
|
||||
@@ -7,7 +7,6 @@ use Getopt::Long;
|
||||
use xCAT::PPCcli qw(SUCCESS EXPECT_ERROR RC_ERROR NR_ERROR);
|
||||
use xCAT::NetworkUtils;
|
||||
use xCAT::FSPUtils;
|
||||
use xCAT::MsgUtils qw(verbose_message);
|
||||
#use Data::Dumper;
|
||||
|
||||
##########################################################################
|
||||
@@ -47,7 +46,7 @@ sub parse_args {
|
||||
$Getopt::Long::ignorecase = 0;
|
||||
Getopt::Long::Configure( "bundling" );
|
||||
|
||||
if ( !GetOptions( \%opt,qw(h|help V|verbose v|version ))) {
|
||||
if ( !GetOptions( \%opt,qw(h|help V|Verbose v|version ))) {
|
||||
return( usage() );
|
||||
}
|
||||
####################################
|
||||
@@ -136,13 +135,12 @@ sub rbootseq {
|
||||
#print "d";
|
||||
#print Dumper($d);
|
||||
|
||||
xCAT::MsgUtils->verbose_message($request, "rbootseq START for node:$node_name, type=$$d[4].");
|
||||
|
||||
if (!($$d[4] =~ /^(lpar|blade)$/)) {
|
||||
push @output, [$node_name, "\'boot\' command not supported for CEC or BPA", -1 ];
|
||||
return (\@output);
|
||||
}
|
||||
# add checking the power state of the cec
|
||||
xCAT::MsgUtils->verbose_message($request, "rbootseq check machine state for node:$node_name.");
|
||||
my $power_state = xCAT::FSPUtils::fsp_api_action ($request, $node_name, $d, "cec_state", $tooltype);
|
||||
if ( @$power_state[2] != 0 ) {
|
||||
push @output, [$node_name, @$power_state[1], -1 ];
|
||||
@@ -207,17 +205,14 @@ sub rbootseq {
|
||||
push @output, [$node_name, "The mac address in mac table could NOT be used for rbootseq with -net. HFI mac , or other wrong format?", -1 ];
|
||||
return( \@output );
|
||||
}
|
||||
xCAT::MsgUtils->verbose_message($request, "rbootseq <$node_name> net=$parameter");
|
||||
}
|
||||
|
||||
if( $opt->{hfi}) {
|
||||
|
||||
$parameter = "/hfi-iohub/hfi-ethernet:$o->{server},,$o->{client},$o->{gateway},$bootp_retries,$tftp_retries,$o->{netmask},$blksize";
|
||||
|
||||
xCAT::MsgUtils->verbose_message($request, "rbootseq <$node_name> hfi=$parameter");
|
||||
}
|
||||
|
||||
xCAT::MsgUtils->verbose_message($request, "rbootseq set_lpar_bootstring for node:$node_name.");
|
||||
my $res = xCAT::FSPUtils::fsp_api_action ($request, $node_name, $d, "set_lpar_bootstring", $tooltype, $parameter);
|
||||
#print "In boot, state\n";
|
||||
#print Dumper($res);
|
||||
@@ -227,7 +222,6 @@ sub rbootseq {
|
||||
##################################
|
||||
# Output error
|
||||
##################################
|
||||
xCAT::MsgUtils->verbose_message($request, "rbootseq return:$Rc.");
|
||||
if ( $Rc != SUCCESS ) {
|
||||
push @output, [$node_name,$data,$Rc];
|
||||
} else {
|
||||
|
||||
@@ -6,11 +6,10 @@ use Getopt::Long;
|
||||
use xCAT::Usage;
|
||||
use xCAT::Utils;
|
||||
use xCAT::FSPUtils;
|
||||
use xCAT::TableUtils;
|
||||
use xCAT::PPCcfg;
|
||||
#use Data::Dumper;
|
||||
#use xCAT::PPCcli;
|
||||
use xCAT::MsgUtils qw(verbose_message);
|
||||
|
||||
|
||||
##########################################
|
||||
# Globals
|
||||
@@ -174,7 +173,7 @@ sub parse_args {
|
||||
Getopt::Long::Configure( "bundling" );
|
||||
$request->{method} = undef;
|
||||
|
||||
if ( !GetOptions( \%opt, qw(V|verbose resetnet))) {
|
||||
if ( !GetOptions( \%opt, qw(V|Verbose resetnet))) {
|
||||
return( usage() );
|
||||
}
|
||||
####################################
|
||||
@@ -225,7 +224,7 @@ sub parse_args {
|
||||
my $ppc_cmds_string = &array_to_string(\@ppc_cmds);
|
||||
return (usage("Invalid command array: $fsp_cmds_string can not execute with $ppc_cmds_string."));
|
||||
} elsif(scalar(@ppc_cmds)) {
|
||||
my @enableASMI = xCAT::TableUtils->get_site_attribute("enableASMI");
|
||||
my @enableASMI = xCAT::Utils->get_site_attribute("enableASMI");
|
||||
if (defined($enableASMI[0])) {
|
||||
$enableASMI[0] =~ tr/a-z/A-Z/; # convert to upper
|
||||
if (($enableASMI[0] eq "1") || ($enableASMI[0] eq "YES")) {
|
||||
@@ -467,7 +466,6 @@ sub do_query {
|
||||
while (my ($mtms, $h) = each(%$hash)) {
|
||||
while (my($name, $d) = each(%$h)) {
|
||||
my $action = $fspapi_action{$cmd}{query}{@$d[4]};
|
||||
xCAT::MsgUtils->verbose_message($request, "rspconfig :$action for node:$name.");
|
||||
my $values = xCAT::FSPUtils::fsp_api_action($request, $name, $d, $action);
|
||||
&do_process_query_res($name, $cmd, \@result, $values);
|
||||
#my $res = &do_process_query_res($name, $cmd, \@result, $values);
|
||||
@@ -514,7 +512,6 @@ sub do_set {
|
||||
while (my ($mtms, $h) = each(%$hash)) {
|
||||
while (my($name, $d) = each(%$h)) {
|
||||
my $action = $fspapi_action{$cmd}{set}{@$d[4]};
|
||||
xCAT::MsgUtils->verbose_message($request, "rspconfig :$action for node:$name, param:$value.");
|
||||
my $para = &do_set_get_para($name, $cmd, $value);
|
||||
my $values = xCAT::FSPUtils::fsp_api_action($request, $name, $d, $action, 0, $para);
|
||||
# print Dumper($values);
|
||||
@@ -598,7 +595,6 @@ sub passwd {
|
||||
while ( my ($node,$d) = each(%$h) ) {
|
||||
my $type = @$d[4];
|
||||
my $fsp_api = ($::XCATROOT) ? "$::XCATROOT/sbin/fsp-api" : "/opt/xcat/sbin/fsp-api";
|
||||
xCAT::MsgUtils->verbose_message($request, "rspconfig :modify password of $usr for node:$node.");
|
||||
my $cmd = xCAT::FSPcfg::fsp_api_passwd ($request, $node, $d, $usr, $passwd, $newpasswd);
|
||||
my $Rc = @$cmd[2];
|
||||
my $data = @$cmd[1];
|
||||
@@ -611,7 +607,6 @@ sub passwd {
|
||||
# Write the new password to table
|
||||
##################################
|
||||
if ( $Rc == 0 ) {
|
||||
xCAT::MsgUtils->verbose_message($request, "rspconfig :update xCATdb for node:$node,ID:$usr.");
|
||||
xCAT::PPCdb::update_credentials( $node, $type, $usr, $newpasswd );
|
||||
}
|
||||
}
|
||||
@@ -682,7 +677,6 @@ sub frame {
|
||||
# Get frame number
|
||||
#################################
|
||||
#$data = xCAT::PPCcli::lssyscfg( $exp, @$d[4], @$d[2], 'frame_num' );
|
||||
xCAT::MsgUtils->verbose_message($request, "rspconfig :get_frame_number for node:$node.");
|
||||
$data = xCAT::FSPUtils::fsp_api_action( $request, $node, $d, "get_frame_number");
|
||||
$Rc = pop(@$data);
|
||||
|
||||
@@ -714,7 +708,6 @@ sub frame {
|
||||
return( [[$node,"Cannot find frame num in database", -1]] );
|
||||
}
|
||||
#$data = xCAT::PPCcli::chsyscfg( $exp, "bpa", $d, "frame_num=".$ent->{id} );
|
||||
xCAT::MsgUtils->verbose_message($request, "rspconfig :set_frame_number for node:$node,id:$ent->{id}.");
|
||||
$data = xCAT::FSPUtils::fsp_api_action( $request, $node, $d, "set_frame_number", 0, $ent->{id});
|
||||
$Rc = pop(@$data);
|
||||
|
||||
@@ -734,7 +727,6 @@ sub frame {
|
||||
# Read the frame number from opt
|
||||
#################################
|
||||
#$data = xCAT::PPCcli::chsyscfg( $exp, "bpa", $d, "frame_num=$value" );
|
||||
xCAT::MsgUtils->verbose_message($request, "rspconfig :set_frame_number for node:$node,id:$value.");
|
||||
$data = xCAT::FSPUtils::fsp_api_action( $request, $node, $d, "set_frame_number", 0, $value);
|
||||
$Rc = pop(@$data);
|
||||
|
||||
@@ -783,7 +775,6 @@ sub cec_off_policy {
|
||||
#################################
|
||||
# Get platform IPL parameters
|
||||
#################################
|
||||
xCAT::MsgUtils->verbose_message($request, "rspconfig :get_phyp_cfg_power_off_policy for node:$node.");
|
||||
$data = xCAT::FSPUtils::fsp_api_action( $request, $node, $d, "get_phyp_cfg_power_off_policy");
|
||||
$Rc = pop(@$data);
|
||||
|
||||
@@ -803,7 +794,6 @@ sub cec_off_policy {
|
||||
#################################
|
||||
# Set cec off policy
|
||||
#################################
|
||||
xCAT::MsgUtils->verbose_message($request, "rspconfig :set power_off_policy for node:$node,policy:$value.");
|
||||
if( $value eq "poweroff") {
|
||||
$value = "cec_off_policy_poweroff";
|
||||
} else {
|
||||
@@ -872,8 +862,8 @@ sub fsp_api_passwd {
|
||||
############################
|
||||
# Get IP address
|
||||
############################
|
||||
#$fsp_ip = xCAT::NetworkUtils::get_hdwr_ip($fsp_name);
|
||||
#$fsp_ip = xCAT::NetworkUtils::getNodeIPaddress($fsp_name);
|
||||
#$fsp_ip = xCAT::Utils::get_hdwr_ip($fsp_name);
|
||||
#$fsp_ip = xCAT::Utils::getNodeIPaddress($fsp_name);
|
||||
#$fsp_ip = xCAT::Utils::getIPaddress($fsp_name);
|
||||
$fsp_ip = xCAT::FSPUtils::getIPaddress($request, $$attrs[4], $fsp_name );
|
||||
if(!defined($fsp_ip) or ($fsp_ip == -3)) {
|
||||
|
||||
@@ -8,7 +8,6 @@ use xCAT::Usage;
|
||||
#use Data::Dumper;
|
||||
use xCAT::FSPUtils;
|
||||
use xCAT::PPCconn;
|
||||
use xCAT::MsgUtils qw(verbose_message);
|
||||
|
||||
##############################################
|
||||
# Globals
|
||||
@@ -572,7 +571,7 @@ sub mkhwconn
|
||||
my $Rc = undef;
|
||||
my $tooltype= $opt->{T};
|
||||
|
||||
xCAT::MsgUtils->verbose_message($request, "mkhwconn START.");
|
||||
|
||||
for my $cec_bpa ( keys %$hash)
|
||||
{
|
||||
my $node_hash = $hash->{$cec_bpa};
|
||||
@@ -597,7 +596,6 @@ sub mkhwconn
|
||||
|
||||
#}
|
||||
|
||||
xCAT::MsgUtils->verbose_message($request, "mkhwconn :add_connection for node:$node_name.");
|
||||
my $res = xCAT::FSPUtils::fsp_api_action($request, $node_name, $d, "add_connection", $tooltype, $opt->{port} );
|
||||
$Rc = @$res[2];
|
||||
if( @$res[1] ne "") {
|
||||
@@ -606,7 +604,6 @@ sub mkhwconn
|
||||
|
||||
}
|
||||
}
|
||||
xCAT::MsgUtils->verbose_message($request, "mkhwconn END.");
|
||||
return \@value;
|
||||
}
|
||||
##########################################################################
|
||||
|
||||
@@ -44,11 +44,11 @@ sub dpush {
|
||||
# Parse the command line for options and operands
|
||||
##########################################################################
|
||||
sub parse_args {
|
||||
my $req = shift;
|
||||
$req->{mgt} = __PACKAGE__;
|
||||
my $req = shift;
|
||||
$req->{mgt} = __PACKAGE__;
|
||||
my $opt = xCAT::PPCrflash::parse_args($req);
|
||||
delete($req->{mgt});
|
||||
return $opt;
|
||||
delete($req->{mgt});
|
||||
return $opt;
|
||||
}
|
||||
|
||||
##########################################################################
|
||||
@@ -340,8 +340,8 @@ sub rflash {
|
||||
#if($activate =~ /^concurrent$/) {
|
||||
my $res = "\'$activate\' option not supported in FSPflash. Please use disruptive or deferred mode";
|
||||
push @value, [$name, $res, -1];
|
||||
next;
|
||||
}
|
||||
next;
|
||||
}
|
||||
|
||||
my $msg;
|
||||
if(!defined($housekeeping)) {
|
||||
|
||||
@@ -66,7 +66,7 @@ sub parse_args {
|
||||
$Getopt::Long::ignorecase = 0;
|
||||
Getopt::Long::Configure( "bundling" );
|
||||
|
||||
if ( !GetOptions( \%opt, qw(V|verbose x) )) {
|
||||
if ( !GetOptions( \%opt, qw(V|Verbose x) )) {
|
||||
return( usage() );
|
||||
}
|
||||
####################################
|
||||
|
||||
@@ -6,7 +6,7 @@ use strict;
|
||||
use Getopt::Long;
|
||||
use xCAT::PPCmac;
|
||||
use xCAT::PPCcli qw(SUCCESS EXPECT_ERROR RC_ERROR NR_ERROR);
|
||||
use xCAT::MsgUtils qw(verbose_message);
|
||||
|
||||
use xCAT::LparNetbootExp;
|
||||
##########################################################################
|
||||
# Parse the command line for options and operands
|
||||
@@ -184,7 +184,6 @@ sub do_getmacs {
|
||||
# last;
|
||||
# }
|
||||
#}
|
||||
xCAT::MsgUtils->verbose_message($request, "getmacs :lparnetbootexp for node:$node.");
|
||||
my $Rc = xCAT::LparNetbootExp->lparnetbootexp(\%optarg, $request);
|
||||
######################################
|
||||
# Split results into array
|
||||
@@ -443,7 +442,6 @@ sub getmacs {
|
||||
#########################################
|
||||
# Connect to fsp to achieve MAC address
|
||||
#########################################
|
||||
xCAT::MsgUtils->verbose_message($request, "getmacs START.");
|
||||
my $d = $par;
|
||||
|
||||
#########################################
|
||||
@@ -503,7 +501,6 @@ sub getmacs {
|
||||
#########################################
|
||||
# Manually collect MAC addresses.
|
||||
#########################################
|
||||
xCAT::MsgUtils->verbose_message($request, "getmacs :do_getmacs for node:$node.");
|
||||
$result = do_getmacs( $request, $d, $exp, $name, $node );
|
||||
#}
|
||||
#$sitetab->close;
|
||||
@@ -578,7 +575,6 @@ sub getmacs {
|
||||
writemac( $node, $value );
|
||||
}
|
||||
#return( [[$node,$data,$Rc]] );
|
||||
xCAT::MsgUtils->verbose_message($request, "getmacs END.");
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ sub powercmd {
|
||||
if($action =~ /^lowpower$/) { $action = "cec_on_low_power"; }
|
||||
#if($action =~ /^cycle$/) {$action = "cec_reboot";}
|
||||
if($action =~ /^cycle$/) {$action = "reset";}
|
||||
if($action !~ /^cec_on_autostart$/ && $action !~ /^cec_off$/ && $action !~ /^cec_on_low_power$/ && $action !~ /^onstandby$/ && $action !~ /^reboot_service_processor$/ && $action !~ /^reset$/ && $action !~ /^sms$/) {
|
||||
if($action !~ /^cec_on_autostart$/ && $action !~ /^cec_off$/ && $action !~ /^cec_on_low_power$/ && $action !~ /^onstandby$/ && $action !~ /^reboot_service_processor$/ && $action !~ /^reset$/) {
|
||||
push @output, [$node_name, "\'$action\' command not supported for $$d[4]", -1 ];
|
||||
return (\@output);
|
||||
}
|
||||
|
||||
@@ -116,9 +116,6 @@ sub enumerate_lcds {
|
||||
} else {
|
||||
my @array = split(/\n/, $data);
|
||||
foreach my $a (@array) {
|
||||
if ($a !~ /:\s?[^\s]*\s?[0|1]/) {
|
||||
next;
|
||||
}
|
||||
my @t = split(/:/, $a);
|
||||
my $name = $t[0];
|
||||
$data = $t[1];
|
||||
@@ -432,10 +429,8 @@ sub lcds {
|
||||
}
|
||||
}
|
||||
|
||||
if( $type eq "lpar" ) {
|
||||
if( $type =~ /lpar/ ) {
|
||||
$action = "query_lcds";
|
||||
} elsif ($type eq "blade") {
|
||||
$action = "pblade_query_lcds";
|
||||
} else {
|
||||
$action = "cec_query_lcds";
|
||||
}
|
||||
|
||||
+3
-19
@@ -16,7 +16,7 @@ use xCAT::Usage;
|
||||
use xCAT::NodeRange;
|
||||
use xCAT::FSPUtils;
|
||||
#use Data::Dumper;
|
||||
use xCAT::MsgUtils qw(verbose_message);
|
||||
|
||||
##############################################
|
||||
# Globals
|
||||
##############################################
|
||||
@@ -644,7 +644,6 @@ sub do_op_extra_cmds {
|
||||
while (my ($mtms, $h) = each(%$hash)) {
|
||||
while (my($name, $d) = each(%$h)) {
|
||||
my $tmp_value = ($param eq '*') ? $name : $param;
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} $action for node:$name, parm:$tmp_value.");
|
||||
my $value = xCAT::FSPUtils::fsp_api_action($request, $name, $d, $action, 0, $tmp_value);
|
||||
if (@$value[1] && ((@$value[1] =~ /Error/i) && (@$value[2] ne '0'))) {
|
||||
return ([[$name, @$value[1], '1']]) ;
|
||||
@@ -699,7 +698,7 @@ sub modify_by_prof {
|
||||
my %io = ();
|
||||
my %lpar_state = ();
|
||||
my @result;
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} START.");
|
||||
|
||||
if (defined( $request->{stdin} )) {
|
||||
my $p = $request->{stdin};
|
||||
my @io = split(/\n/, $p) ;
|
||||
@@ -722,7 +721,6 @@ sub modify_by_prof {
|
||||
}
|
||||
$td->[4] = "cec";
|
||||
#get the current I/O slot information
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} :get_io_slot_info for node:$cec_name.");
|
||||
my $action = "get_io_slot_info";
|
||||
my $values = xCAT::FSPUtils::fsp_api_action ($request, $cec_name, $td, $action);
|
||||
my $Rc = $$values[2];
|
||||
@@ -739,7 +737,6 @@ sub modify_by_prof {
|
||||
}
|
||||
|
||||
#get all the nodes state in the same cec
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} :get all the nodes state for CEC:$cec_name.");
|
||||
$action = "all_lpars_state";
|
||||
undef($values);
|
||||
my $values = xCAT::FSPUtils::fsp_state_action ($request, $cec_name, $td, $action);
|
||||
@@ -774,7 +771,6 @@ sub modify_by_prof {
|
||||
return ( \@result );
|
||||
}
|
||||
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} :set_io_slot_owner io_slot_info:$f,owner:$lpar.");
|
||||
my $values = xCAT::FSPUtils::fsp_api_action ($request, $lpar, $d, $action, $tooltype, $drc_index);
|
||||
#my $Rc = shift(@$values);
|
||||
my $Rc = pop(@$values);
|
||||
@@ -786,7 +782,6 @@ sub modify_by_prof {
|
||||
|
||||
}
|
||||
}
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} END.");
|
||||
return( \@result );
|
||||
}
|
||||
|
||||
@@ -801,7 +796,6 @@ sub enumerate {
|
||||
my $type;
|
||||
my @td;
|
||||
|
||||
xCAT::MsgUtils->verbose_message($request, "lsvm :enumerate START for mtms:$mtms.");
|
||||
while (my ($name,$d) = each(%$h) ) {
|
||||
$cec = @$d[3];
|
||||
$type = @$d[4];
|
||||
@@ -809,7 +803,6 @@ sub enumerate {
|
||||
}
|
||||
|
||||
$td[4]="cec";
|
||||
xCAT::MsgUtils->verbose_message($request, "lsvm :enumerate get_io_slot_info for node:$cec.");
|
||||
my $action = "get_io_slot_info";
|
||||
my $values = xCAT::FSPUtils::fsp_api_action ($request, $cec, \@td, $action);
|
||||
#my $Rc = shift(@$values);
|
||||
@@ -826,7 +819,6 @@ sub enumerate {
|
||||
#}
|
||||
|
||||
if( $type =~ /^(fsp|cec)$/ ) {
|
||||
xCAT::MsgUtils->verbose_message($request, "lsvm :enumerate query_octant_cfg for node:$cec.");
|
||||
$action = "query_octant_cfg";
|
||||
my $values = xCAT::FSPUtils::fsp_api_action ($request, $cec, \@td, $action);
|
||||
my $Rc = pop(@$values);
|
||||
@@ -847,7 +839,6 @@ sub enumerate {
|
||||
$outhash{ $cec } = $res;
|
||||
}
|
||||
|
||||
xCAT::MsgUtils->verbose_message($request, "lsvm :enumerate END for mtms:$mtms.");
|
||||
return( [0,\%outhash] );
|
||||
}
|
||||
|
||||
@@ -996,7 +987,6 @@ sub list {
|
||||
my %lpar_huges = ();
|
||||
my $l_string = "\n";
|
||||
#print Dumper($hash);
|
||||
xCAT::MsgUtils->verbose_message($request, "lsvm START");
|
||||
while (my ($mtms,$h) = each(%$hash) ) {
|
||||
my $info = enumerate($request, $h, $mtms );
|
||||
my $Rc = shift(@$info);
|
||||
@@ -1019,7 +1009,7 @@ sub list {
|
||||
# push @result, [$node_name, "Node not found",1];
|
||||
# next;
|
||||
# }
|
||||
xCAT::MsgUtils->verbose_message($request, "lsvm :parse io info for node:$node_name.");
|
||||
|
||||
if( defined($msg)) {
|
||||
push @result,[$node_name, $msg, 0];
|
||||
} else {
|
||||
@@ -1094,7 +1084,6 @@ sub list {
|
||||
|
||||
# get the octant configuration value
|
||||
if ($type=~/^(fsp|cec)$/) {
|
||||
xCAT::MsgUtils->verbose_message($request, "lsvm :parse octant info for $type:$node_name.");
|
||||
my $value = $data->{$cec};
|
||||
if ($request->{opt}->{l}) {
|
||||
my $cec_bsr = get_cec_cec_bsr($node_name, $bsr_infos);
|
||||
@@ -1112,7 +1101,6 @@ sub list {
|
||||
$l_string = "\n";
|
||||
} # end of while
|
||||
}# end of while
|
||||
xCAT::MsgUtils->verbose_message($request, "lsvm END.");
|
||||
return( \@result );
|
||||
}
|
||||
|
||||
@@ -1206,7 +1194,6 @@ sub create {
|
||||
my %node_id = ();
|
||||
my @nodes = @{$opt->{target}};
|
||||
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} START.");
|
||||
#print Dumper($request);
|
||||
#####################################
|
||||
# Get source node information
|
||||
@@ -1226,7 +1213,6 @@ sub create {
|
||||
}
|
||||
}
|
||||
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} :query_octant_cfg for CEC:$cec_name.");
|
||||
my $values = xCAT::FSPUtils::fsp_api_action ($request, $cec_name, $d, "query_octant_cfg");
|
||||
my $Rc = shift(@$values);
|
||||
if ( $Rc != 0 ) {
|
||||
@@ -1303,7 +1289,6 @@ sub create {
|
||||
|
||||
|
||||
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} :set_octant_cfg for CEC:$cec_name,param:$parameters.");
|
||||
#$values = xCAT::FSPUtils::fsp_api_create_parttion( $starting_lpar_id, $octant_cfg, $node_number, $d, "set_octant_cfg");
|
||||
$values = xCAT::FSPUtils::fsp_api_action ($request,$cec_name, $d, "set_octant_cfg", 0, $parameters);
|
||||
my $Rc = $$values[2];
|
||||
@@ -1321,7 +1306,6 @@ sub create {
|
||||
|
||||
}
|
||||
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} END.");
|
||||
return( \@result );
|
||||
}
|
||||
|
||||
|
||||
@@ -33,13 +33,6 @@ $::NODETYPE_PPC="ppc";
|
||||
$::NODETYPE_ZVM="zvm";
|
||||
$::NODETYPE_MP="mp";
|
||||
|
||||
#valid values for nodelist.updatestatus
|
||||
$::STATUS_SYNCING="syncing";
|
||||
$::STATUS_OUT_OF_SYNC="out-of-sync";
|
||||
$::STATUS_SYNCED="synced";
|
||||
$::STATUS_FAILED="failed";
|
||||
|
||||
|
||||
# valid values for nodelist.status columns or other status
|
||||
$::STATUS_ACTIVE="alive";
|
||||
$::STATUS_INACTIVE="unreachable";
|
||||
@@ -55,28 +48,6 @@ $::STATUS_STANDING_BY="standingby";
|
||||
$::STATUS_SHELL="shell";
|
||||
$::STATUS_DEFINED="defined";
|
||||
$::STATUS_UNKNOWN="unknown";
|
||||
$::STATUS_FAILED="failed";
|
||||
%::VALID_STATUS_VALUES = (
|
||||
$::STATUS_ACTIVE=>1,
|
||||
$::STATUS_INACTIVE=>1,
|
||||
$::STATUS_INSTALLING=>1,
|
||||
$::STATUS_INSTALLED=>1,
|
||||
$::STATUS_BOOTING=>1,
|
||||
$::STATUS_NETBOOTING=>1,
|
||||
$::STATUS_BOOTED=>1,
|
||||
$::STATUS_POWERING_OFF=>1,
|
||||
$::STATUS_DISCOVERING=>1,
|
||||
$::STATUS_CONFIGURING=>1,
|
||||
$::STATUS_STANDING_BY=>1,
|
||||
$::STATUS_SHELL=>1,
|
||||
$::STATUS_DEFINED=>1,
|
||||
$::STATUS_UNKNOWN=>1,
|
||||
$::STATUS_FAILED=>1,
|
||||
|
||||
$::STATUS_SYNCING=>1,
|
||||
$::STATUS_OUT_OF_SYNC=>1,
|
||||
$::STATUS_SYNCED=>1,
|
||||
);
|
||||
|
||||
#defined->[discovering]->[configuring]->[standingby]->installing->[installed]->booting->alive, defined->[discovering]->[configuring]-[standingby]->netbooting->booted->alive, alive/unreachable->booting->alive, powering-off->unreachable, alive->unreachable
|
||||
%::NEXT_NODESTAT_VAL=(
|
||||
|
||||
+20
-22
@@ -9,8 +9,12 @@ BEGIN
|
||||
|
||||
# if AIX - make sure we include perl 5.8.2 in INC path.
|
||||
# Needed to find perl dependencies shipped in deps tarball.
|
||||
if ($^O =~ /^aix/i) {
|
||||
unshift(@INC, qw(/usr/opt/perl5/lib/5.8.2/aix-thread-multi /usr/opt/perl5/lib/5.8.2 /usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi /usr/opt/perl5/lib/site_perl/5.8.2));
|
||||
if ($^O =~ /^aix/i)
|
||||
{
|
||||
use lib "/usr/opt/perl5/lib/5.8.2/aix-thread-multi";
|
||||
use lib "/usr/opt/perl5/lib/5.8.2";
|
||||
use lib "/usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi";
|
||||
use lib "/usr/opt/perl5/lib/site_perl/5.8.2";
|
||||
}
|
||||
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
@@ -23,7 +27,7 @@ use File::Path;
|
||||
use strict;
|
||||
require xCAT::Schema;
|
||||
use xCAT::NetworkUtils;
|
||||
use xCAT::TableUtils;
|
||||
|
||||
#require Data::Dumper;
|
||||
#use Data::Dumper;
|
||||
require xCAT::NodeRange;
|
||||
@@ -67,14 +71,12 @@ sub getnimprime
|
||||
# the primary NIM master is either specified in the site table
|
||||
# or it is the xCAT management node.
|
||||
|
||||
my $nimprime = xCAT::TableUtils->get_site_Master();
|
||||
#my $sitetab = xCAT::Table->new('site');
|
||||
#(my $et) = $sitetab->getAttribs({key => "nimprime"}, 'value');
|
||||
my @nimprimes = xCAT::TableUtils->get_site_attribute("nimprime");
|
||||
my $tmp = $nimprimes[0];
|
||||
if (defined($tmp))
|
||||
my $nimprime = xCAT::Utils->get_site_Master();
|
||||
my $sitetab = xCAT::Table->new('site');
|
||||
(my $et) = $sitetab->getAttribs({key => "nimprime"}, 'value');
|
||||
if ($et and $et->{value})
|
||||
{
|
||||
$nimprime = $tmp;
|
||||
$nimprime = $et->{value};
|
||||
}
|
||||
|
||||
my $hostname;
|
||||
@@ -126,7 +128,7 @@ sub myxCATname
|
||||
if (xCAT::Utils->isMN())
|
||||
{
|
||||
# read the site table, master attrib
|
||||
my $hostname = xCAT::TableUtils->get_site_Master();
|
||||
my $hostname = xCAT::Utils->get_site_Master();
|
||||
if (($hostname =~ /\d+\.\d+\.\d+\.\d+/) || ($hostname =~ /:/))
|
||||
{
|
||||
$name = xCAT::NetworkUtils->gethostname($hostname);
|
||||
@@ -750,11 +752,11 @@ sub get_server_nodes
|
||||
else
|
||||
{
|
||||
# get ip facing node
|
||||
$serv = xCAT::NetworkUtils->my_ip_facing($node);
|
||||
$serv = xCAT::Utils->my_ip_facing($node);
|
||||
}
|
||||
chomp $serv;
|
||||
|
||||
if (xCAT::NetworkUtils->validate_ip($serv)) {
|
||||
if (xCAT::Utils->validate_ip($serv)) {
|
||||
push (@{$servernodes{$serv}}, $node);
|
||||
}
|
||||
}
|
||||
@@ -893,12 +895,12 @@ sub dolitesetup
|
||||
}
|
||||
}
|
||||
|
||||
if (-e $litetreetable) {
|
||||
my $rc = xCAT::Utils->runcmd("rm $litetreetable", -1);
|
||||
if (-e $litetreetab) {
|
||||
my $rc = xCAT::Utils->runcmd("rm $litetreetab", -1);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
my $rsp;
|
||||
push @{$rsp->{data}}, "Could not remove existing $litetreetable file.";
|
||||
push @{$rsp->{data}}, "Could not remove existing $litetreetab file.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback);
|
||||
return 1;
|
||||
}
|
||||
@@ -1132,11 +1134,7 @@ sub dolitesetup
|
||||
# $file could be full path file name or dir name
|
||||
# ex. /foo/bar/ or /etc/lppcfg
|
||||
my ($node, $option, $file) = split (/\|/, $line);
|
||||
|
||||
if (!$file) {
|
||||
next;
|
||||
}
|
||||
|
||||
|
||||
# ex. .../inst_root/foo/bar/ or .../inst_root/etc/lppcfg
|
||||
my $instrootfile = $instrootloc . $file;
|
||||
|
||||
@@ -1286,7 +1284,7 @@ sub dolitesetup
|
||||
|
||||
# add aixlitesetup to ..inst_root/aixlitesetup
|
||||
# this will wind up in the root dir on the node ("/")
|
||||
my $install_dir = xCAT::TableUtils->getInstallDir();
|
||||
my $install_dir = xCAT::Utils->getInstallDir();
|
||||
my $cpcmd = "/bin/cp $install_dir/postscripts/aixlitesetup $instrootloc/aixlitesetup; chmod +x $instrootloc/aixlitesetup";
|
||||
|
||||
my $out = xCAT::Utils->runcmd("$cpcmd", -1);
|
||||
|
||||
@@ -1,199 +0,0 @@
|
||||
#!/usr/bin/env perl
|
||||
## IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
package xCAT::KitPluginUtils;
|
||||
|
||||
BEGIN
|
||||
{
|
||||
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
|
||||
}
|
||||
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
require xCAT::Table;
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 get_kits_used_by_nodes
|
||||
|
||||
Get the kits used by a list of nodes. A node uses a kit
|
||||
if one or more of the kit's components are installed
|
||||
on the node.
|
||||
|
||||
Arguments: list of node names (ref)
|
||||
|
||||
Returns: Return hash table which indexes the node names
|
||||
by kitname (ref)
|
||||
e.g.,
|
||||
{ "kitname1" => ["node11","node12",...],
|
||||
"kitname2" => ["node21","node22",...]
|
||||
...
|
||||
}
|
||||
|
||||
Examples:
|
||||
my @nodes = ("node11", "node12",...);
|
||||
my $result = xCAT::KitPluginUtils->get_kits_used_by_nodes(\@nodes);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub get_kits_used_by_nodes {
|
||||
|
||||
my $class = shift;
|
||||
my $nodes = shift;
|
||||
|
||||
# Group the nodes by what osimage they use
|
||||
my $tablename = "nodetype";
|
||||
my $table = xCAT::Table->new($tablename);
|
||||
my $ent = $table->getNodesAttribs($nodes, ["provmethod"]);
|
||||
|
||||
my $osimage_to_nodes = {};
|
||||
foreach my $node (keys(%$ent)) {
|
||||
my $provmethod = $ent->{$node}->[0]->{"provmethod"};
|
||||
if (defined($provmethod)) {
|
||||
push(@{ $osimage_to_nodes->{$provmethod} }, $node);
|
||||
}
|
||||
}
|
||||
|
||||
# Group the osimages by what kits they use
|
||||
my @osimages = keys(%$osimage_to_nodes);
|
||||
my $kits_to_osimages = xCAT::KitPluginUtils->get_kits_used_by_osimages(\@osimages);
|
||||
|
||||
|
||||
# Group nodes by kit
|
||||
my $kits_to_nodes = {};
|
||||
foreach my $kit (keys(%$kits_to_osimages)) {
|
||||
my $tmphash = {};
|
||||
my $osimages = $kits_to_osimages->{$kit};
|
||||
foreach my $osimage (@$osimages) {
|
||||
# Store nodes as hash keys to eliminate duplicates
|
||||
my @nodes = @{ $osimage_to_nodes->{$osimage} };
|
||||
@$tmphash{@nodes} = ();
|
||||
}
|
||||
my @nodes = keys(%$tmphash);
|
||||
$kits_to_nodes->{$kit} = \@nodes;
|
||||
}
|
||||
|
||||
return $kits_to_nodes;
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 get_kits_used_by_osimages
|
||||
|
||||
Get the kits used by a list of osimages. An osimage
|
||||
uses a kit if one or more of the kit's components
|
||||
are associated with the osimage.
|
||||
|
||||
Arguments: list of osimage names (ref)
|
||||
|
||||
Returns: Return hash table which indexes the osimage
|
||||
names by kitname (ref)
|
||||
e.g.,
|
||||
{ "kitname1" => ["osimage11","osimage12",...],
|
||||
"kitname2" => ["osimage21","osimage22",...]
|
||||
...
|
||||
}
|
||||
|
||||
Examples:
|
||||
my @osimages = ("osimage11","osimage12", ...);
|
||||
my $result = xCAT::KitPluginUtils->get_kits_used_by_osimages(\@osimages);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub get_kits_used_by_osimages {
|
||||
|
||||
my $class = shift;
|
||||
my $osimages = shift;
|
||||
|
||||
# Get the kit components used by each osimage
|
||||
my $tablename = "osimage";
|
||||
my $table = xCAT::Table->new($tablename);
|
||||
|
||||
my $osimages_str = join ",", map {'\''.$_.'\''} @$osimages;
|
||||
my $filter_stmt = sprintf("imagename in (%s)", $osimages_str);
|
||||
my @table_rows = $table->getAllAttribsWhere($filter_stmt, ("imagename", "kitcomponents"));
|
||||
|
||||
my $kitcomps_to_osimages = {};
|
||||
foreach my $row (@table_rows) {
|
||||
if (defined($row->{kitcomponents})) {
|
||||
my @kitcomps = split(/,/, $row->{kitcomponents});
|
||||
foreach my $kitcomp (@kitcomps) {
|
||||
push(@{ $kitcomps_to_osimages->{$kitcomp} }, $row->{imagename});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Get the kit for each kit component
|
||||
$tablename = "kitcomponent";
|
||||
$table = xCAT::Table->new($tablename);
|
||||
|
||||
my $kitcomps_str = join ",", map {'\''.$_.'\''} keys(%$kitcomps_to_osimages);
|
||||
$filter_stmt = sprintf("kitcompname in (%s)", $kitcomps_str);
|
||||
@table_rows = $table->getAllAttribsWhere($filter_stmt, ("kitcompname", "kitname"));
|
||||
|
||||
my $kits_to_kitcomps = {};
|
||||
foreach my $row (@table_rows) {
|
||||
my $kitname = $row->{kitname};
|
||||
my $kitcompname = $row->{kitcompname};
|
||||
push(@{ $kits_to_kitcomps->{$kitname} }, $kitcompname);
|
||||
}
|
||||
|
||||
# Match up kits to osimages
|
||||
|
||||
my $kits_to_osimages = {};
|
||||
foreach my $kit (keys(%$kits_to_kitcomps)) {
|
||||
my $tmphash = {};
|
||||
my $kitcomps = $kits_to_kitcomps->{$kit};
|
||||
foreach my $kitcomp (@$kitcomps) {
|
||||
# Store osimages as hash keys to eliminate duplicates
|
||||
my @osimages = @{ $kitcomps_to_osimages->{$kitcomp} };
|
||||
@$tmphash{@osimages} = ();
|
||||
}
|
||||
my @osimages = keys(%$tmphash);
|
||||
$kits_to_osimages->{$kit} = \@osimages;
|
||||
}
|
||||
|
||||
return $kits_to_osimages;
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 get_kits_used_by_image_profiles
|
||||
|
||||
Get the kits used by a list of image profiles.
|
||||
|
||||
Arguments: list of image profile names (ref)
|
||||
|
||||
Returns: Return hash table which indexes the image
|
||||
profile names by kitname (ref)
|
||||
e.g.,
|
||||
{ "kitname1" => ["imgprofile11","imgprofile12",...],
|
||||
"kitname2" => ["imgprofile21","imgprofile22",...]
|
||||
...
|
||||
}
|
||||
|
||||
Examples:
|
||||
my @imgprofiles = ("imgprofile11","imgprofile12",...);
|
||||
my $result = xCAT::KitPluginUtils->get_kits_used_by_image_profiles(\@imgprofiles);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub get_kits_used_by_image_profiles {
|
||||
|
||||
my $class = shift;
|
||||
return xCAT::KitPluginUtils->get_kits_used_by_osimages(@_);
|
||||
}
|
||||
|
||||
|
||||
@@ -1849,14 +1849,6 @@ sub boot_network {
|
||||
$state = $newstate[$state];
|
||||
}
|
||||
],
|
||||
# For some old firmware, does not output "----"
|
||||
[qr/BOOTP/=>
|
||||
sub {
|
||||
nc_msg ($verbose, $msg[$state]);
|
||||
$rconsole->clear_accum();
|
||||
$state = $newstate[$state];
|
||||
}
|
||||
],
|
||||
[qr/]/=>
|
||||
sub {
|
||||
nc_msg($verbose, "Unexpected prompt\n");
|
||||
@@ -1925,28 +1917,7 @@ sub Boot {
|
||||
#],
|
||||
[qr/BOOTP/=> #-ex
|
||||
sub {
|
||||
nc_msg($verbose, "# Network boot proceeding - matched BOOTP, exiting.\n");
|
||||
$rconsole->clear_accum();
|
||||
}
|
||||
],
|
||||
# Welcome to AIX - some old firmware does not output BOOTP or ----
|
||||
[qr/Welcome/=> #-ex
|
||||
sub {
|
||||
nc_msg($verbose, "# Network boot proceeding - matched Welcome, exiting.\n");
|
||||
$rconsole->clear_accum();
|
||||
}
|
||||
],
|
||||
# tftp file download - some old firmware does not output BOOTP or ----
|
||||
[qr/FILE/=> #-ex
|
||||
sub {
|
||||
nc_msg($verbose, "# Network boot proceeding - matched FILE.\n");
|
||||
$rconsole->clear_accum();
|
||||
}
|
||||
],
|
||||
# some old firmware does not output BOOTP or ----
|
||||
[qr/Elapsed/=> #-ex
|
||||
sub {
|
||||
nc_msg($verbose, "# Network boot proceeding - matched Elapsed, exiting.\n");
|
||||
nc_msg($verbose, "# Network boot proceeding, exiting.\n");
|
||||
$rconsole->clear_accum();
|
||||
}
|
||||
],
|
||||
@@ -3177,12 +3148,12 @@ sub lparnetbootexp
|
||||
}
|
||||
],
|
||||
);
|
||||
return [1] if ($rc eq 1);
|
||||
nc_msg($verbose, "# bootp sent over network.\n");
|
||||
$rc = Boot($rconsole, $node, $verbose);#, @expect_out);
|
||||
unless ($rc eq 0) {
|
||||
nc_msg($verbose, "Can't boot here. \n");
|
||||
}
|
||||
return [1] if ($rc eq 1);
|
||||
}
|
||||
nc_msg($verbose, "# bootp sent over network.\n");
|
||||
$rc = Boot($rconsole, $node, $verbose);#, @expect_out);
|
||||
unless ($rc eq 0) {
|
||||
nc_msg($verbose, "Can't boot here. \n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ use strict;
|
||||
use xCAT::Table;
|
||||
use xCAT::Utils;
|
||||
use xCAT::MsgUtils;
|
||||
use xCAT::TableUtils;
|
||||
use IO::Select;
|
||||
use IO::Handle;
|
||||
use Sys::Syslog;
|
||||
@@ -173,11 +172,9 @@ sub rvlan {
|
||||
# operation => "pvid=<vid> or vlan=<vid>" for now, addvlan= and delvlan= for tagged vlans, 'pvid', vlan, or stat without = checks current value
|
||||
my $self=shift;
|
||||
my $community = "public";
|
||||
#$self->{sitetab} = xCAT::Table->new('site');
|
||||
#my $tmp = $self->{sitetab}->getAttribs({key=>'snmpc'},'value');
|
||||
my @snmpcs = xCAT::TableUtils->get_site_attribute("snmpc");
|
||||
my $tmp = $snmpcs[0];
|
||||
if ( defined($tmp) ) { $community = $tmp }
|
||||
$self->{sitetab} = xCAT::Table->new('site');
|
||||
my $tmp = $self->{sitetab}->getAttribs({key=>'snmpc'},'value');
|
||||
if ($tmp and $tmp->{value}) { $community = $tmp->{value} }
|
||||
my %args = @_;
|
||||
my $op=$args{operation};
|
||||
my $nodes=$args{nodes};
|
||||
@@ -305,12 +302,9 @@ sub refresh_table {
|
||||
$self->{switchestab} = xCAT::Table->new('switches', -create => 1);
|
||||
my @switchentries=$self->{switchestab}->getAllNodeAttribs([qw(switch snmpversion username password privacy auth)]);
|
||||
my $community = "public";
|
||||
#$self->{sitetab} = xCAT::Table->new('site');
|
||||
#my $tmp = $self->{sitetab}->getAttribs({key=>'snmpc'},'value');
|
||||
#if ($tmp and $tmp->{value}) { $community = $tmp->{value} }
|
||||
my @snmpcs = xCAT::TableUtils->get_site_attribute("snmpc");
|
||||
my $tmp = $snmpcs[0];
|
||||
if ( defined($tmp) ) { $community = $tmp }
|
||||
$self->{sitetab} = xCAT::Table->new('site');
|
||||
my $tmp = $self->{sitetab}->getAttribs({key=>'snmpc'},'value');
|
||||
if ($tmp and $tmp->{value}) { $community = $tmp->{value} }
|
||||
else { #Would warn here..
|
||||
}
|
||||
$self->{switchparmhash}={};
|
||||
|
||||
+12
-12
@@ -5,8 +5,12 @@ package xCAT::MsgUtils;
|
||||
|
||||
# if AIX - make sure we include perl 5.8.2 in INC path.
|
||||
# Needed to find perl dependencies shipped in deps tarball.
|
||||
if ($^O =~ /^aix/i) {
|
||||
unshift(@INC, qw(/usr/opt/perl5/lib/5.8.2/aix-thread-multi /usr/opt/perl5/lib/5.8.2 /usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi /usr/opt/perl5/lib/site_perl/5.8.2));
|
||||
if ($^O =~ /^aix/i)
|
||||
{
|
||||
use lib "/usr/opt/perl5/lib/5.8.2/aix-thread-multi";
|
||||
use lib "/usr/opt/perl5/lib/5.8.2";
|
||||
use lib "/usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi";
|
||||
use lib "/usr/opt/perl5/lib/site_perl/5.8.2";
|
||||
}
|
||||
|
||||
use strict;
|
||||
@@ -133,8 +137,7 @@ This program module file, supports the xcat messaging and logging
|
||||
|
||||
D - DATA goes to STDOUT
|
||||
E - error. This type of message will be sent to STDERR.
|
||||
si - informational status info (sinfo)
|
||||
I - informational goes to STDOUT
|
||||
I - informational goes to STDOUT
|
||||
N - Node informational goes to STDOUT
|
||||
S - Message will be logged to syslog ( severe error)
|
||||
Note S can be combined with other flags for example
|
||||
@@ -210,14 +213,12 @@ This program module file, supports the xcat messaging and logging
|
||||
$rsp->{node}->[0]->{data}->[0] ="mydata";
|
||||
xCAT::MsgUtils->message("N", $rsp, $callback);
|
||||
|
||||
|
||||
|
||||
my $rsp = {};
|
||||
$rsp->{info}->[0] = "No hosts in node list\n";
|
||||
xCAT::MsgUtils->message("I", $rsp, $::CALLBACK);
|
||||
|
||||
my $rsp = {};
|
||||
$rsp->{sinfo}->[0] = "No hosts in node list\n";
|
||||
xCAT::MsgUtils->message("IS", $rsp, $::CALLBACK);
|
||||
|
||||
|
||||
my $rsp = {};
|
||||
$rsp->{warning}->[0] = "No hosts in node list\n";
|
||||
@@ -274,7 +275,7 @@ sub message
|
||||
my $call_back = shift; # optional
|
||||
my $exitcode = shift; # optional
|
||||
|
||||
# should be I,IS, D, E, S, SA ,LS, W , L,N
|
||||
# should be I, D, E, S, SA ,LS, W , L,N
|
||||
# or S(I, D, E, S, W, L,N)
|
||||
#
|
||||
# if new SA option need to split syslog messages from auditlog entry
|
||||
@@ -356,7 +357,6 @@ sub message
|
||||
my $sevkey;
|
||||
if ($sev =~ /D/) { $sevkey = 'data'; }
|
||||
elsif ($sev =~ /N/) { $sevkey = 'node'; }
|
||||
elsif ($sev =~ /IS/) { $sevkey = 'sinfo'; }
|
||||
elsif ($sev =~ /I/) { $sevkey = 'info'; }
|
||||
elsif ($sev =~ /W/) { $sevkey = 'warning'; }
|
||||
elsif ($sev =~ /E/)
|
||||
@@ -408,7 +408,7 @@ sub message
|
||||
return;
|
||||
}
|
||||
|
||||
if (defined($exitcode))
|
||||
if ($exitcode)
|
||||
{
|
||||
push @{$rsp->{errorcode}}, $exitcode;
|
||||
}
|
||||
@@ -720,7 +720,7 @@ sub verbose_message
|
||||
}
|
||||
my ($sec,$min,$hour,$mday,$mon,$yr,$wday,$yday,$dst) = localtime(time);
|
||||
my $time = sprintf "%04d%02d%02d.%02d:%02d:%02d", $yr+1900,$mon+1,$mday,$hour,$min,$sec;
|
||||
$data = "$time ($$) ".$data;
|
||||
$data = "$time ($$) ".$data;
|
||||
if (defined($req->{callback})) {
|
||||
my %rsp;
|
||||
$rsp{data} = [$data];
|
||||
|
||||
@@ -0,0 +1,271 @@
|
||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
package xCAT::NameRange;
|
||||
require xCAT::Table;
|
||||
require Exporter;
|
||||
use strict;
|
||||
|
||||
#Perl implementation of namerange
|
||||
# NOTE: This is identical to xCAT::NodeRange except that no
|
||||
# database access occurs, no nodes are verified, and
|
||||
# no nodegroups are expanded.
|
||||
# Made a new utility since NodeRange is used EVERYWHERE in
|
||||
# xCAT code and did not want to risk de-stabilizing existing code.
|
||||
our @ISA = qw(Exporter);
|
||||
our @EXPORT = qw(namerange);
|
||||
|
||||
my $recurselevel=0;
|
||||
|
||||
|
||||
sub subnodes (\@@) {
|
||||
#Subtract set of nodes from the first list
|
||||
my $nodes = shift;
|
||||
my $node;
|
||||
foreach $node (@_) {
|
||||
@$nodes = (grep(!/^$node$/,@$nodes));
|
||||
}
|
||||
}
|
||||
|
||||
sub expandatom {
|
||||
my $atom = shift;
|
||||
my @nodes= ();
|
||||
if ($atom =~ /^\(.*\)$/) { # handle parentheses by recursively calling namerange()
|
||||
$atom =~ s/^\((.*)\)$/$1/;
|
||||
$recurselevel++;
|
||||
return namerange($atom);
|
||||
}
|
||||
if ($atom =~ /@/) {
|
||||
$recurselevel++;
|
||||
return namerange($atom);
|
||||
}
|
||||
|
||||
if ($atom =~ m/^\//) { # A regular expression - not supported in namerange
|
||||
return ($atom);
|
||||
}
|
||||
|
||||
if ($atom =~ m/(.*)\[(.*)\](.*)/) { # square bracket range
|
||||
#for the time being, we are only going to consider one [] per atom
|
||||
#xcat 1.2 does no better
|
||||
my @subelems = split(/([\,\-\:])/,$2);
|
||||
my $subrange="";
|
||||
while (my $subelem = shift @subelems) {
|
||||
my $subop=shift @subelems;
|
||||
$subrange=$subrange."$1$subelem$3$subop";
|
||||
}
|
||||
foreach (split /,/,$subrange) {
|
||||
my @newnodes=expandatom($_);
|
||||
@nodes=(@nodes,@newnodes);
|
||||
}
|
||||
return @nodes;
|
||||
}
|
||||
|
||||
if ($atom =~ m/\+/) { # process the + operator
|
||||
$atom =~ m/^([^0-9]*)([0-9]+)([^\+]*)\+([0-9]+)/;
|
||||
my $pref=$1;
|
||||
my $startnum=$2;
|
||||
my $suf=$3;
|
||||
my $end=$4+$startnum;
|
||||
my $endnum = sprintf("%d",$end);
|
||||
if (length ($startnum) > length ($endnum)) {
|
||||
$endnum = sprintf("%0".length($startnum)."d",$end);
|
||||
}
|
||||
foreach ("$startnum".."$endnum") {
|
||||
my @addnodes=expandatom($pref.$_.$suf);
|
||||
@nodes=(@nodes,@addnodes);
|
||||
}
|
||||
return (@nodes);
|
||||
}
|
||||
|
||||
if ($atom =~ m/[-:]/) { # process the minus range operator
|
||||
my $left;
|
||||
my $right;
|
||||
if ($atom =~ m/:/) {
|
||||
($left,$right)=split /:/,$atom;
|
||||
} else {
|
||||
my $count= ($atom =~ tr/-//);
|
||||
if (($count % 2)==0) { #can't understand even numbers of - in range context
|
||||
# we might not really be in range context
|
||||
return ($atom);
|
||||
}
|
||||
my $expr="([^-]+?".("-[^-]*"x($count/2)).")-(.*)";
|
||||
$atom =~ m/$expr/;
|
||||
$left=$1;
|
||||
$right=$2;
|
||||
}
|
||||
if ($left eq $right) { #if they said node1-node1 for some strange reason
|
||||
return expandatom($left);
|
||||
}
|
||||
my @leftarr=split(/(\d+)/,$left);
|
||||
my @rightarr=split(/(\d+)/,$right);
|
||||
if (scalar(@leftarr) != scalar(@rightarr)) { #Mismatch formatting..
|
||||
# guess it's meant to be a nodename
|
||||
return ($atom);
|
||||
}
|
||||
my $prefix = "";
|
||||
my $suffix = "";
|
||||
foreach (0..$#leftarr) {
|
||||
my $idx = $_;
|
||||
if ($leftarr[$idx] =~ /^\d+$/ and $rightarr[$idx] =~ /^\d+$/) { #pure numeric component
|
||||
if ($leftarr[$idx] ne $rightarr[$idx]) { #We have found the iterator (only supporting one for now)
|
||||
my $prefix = join('',@leftarr[0..($idx-1)]); #Make a prefix of the pre-validated parts
|
||||
my $luffix; #However, the remainder must still be validated to be the same
|
||||
my $ruffix;
|
||||
if ($idx eq $#leftarr) {
|
||||
$luffix="";
|
||||
$ruffix="";
|
||||
} else {
|
||||
$ruffix = join('',@rightarr[($idx+1)..$#rightarr]);
|
||||
$luffix = join('',@leftarr[($idx+1)..$#leftarr]);
|
||||
}
|
||||
if ($luffix ne $ruffix) { #the suffixes mismatched..
|
||||
return ($atom);
|
||||
}
|
||||
foreach ($leftarr[$idx]..$rightarr[$idx]) {
|
||||
my @addnodes=expandatom($prefix.$_.$luffix);
|
||||
@nodes=(@nodes,@addnodes);
|
||||
}
|
||||
return (@nodes); #the return has been built, return, exiting loop and all
|
||||
}
|
||||
} elsif ($leftarr[$idx] ne $rightarr[$idx]) {
|
||||
return ($atom);
|
||||
}
|
||||
$prefix .= $leftarr[$idx]; #If here, it means that the pieces were the same, but more to come
|
||||
}
|
||||
#I cannot conceive how the code could possibly be here, but whatever it is, it must be questionable
|
||||
return ($atom);
|
||||
}
|
||||
|
||||
return ($atom);
|
||||
}
|
||||
|
||||
sub namerange {
|
||||
#We for now just do left to right operations
|
||||
my $range=shift;
|
||||
my %nodes = ();
|
||||
my %delnodes = ();
|
||||
my $op = ",";
|
||||
my @elems = split(/(,(?![^[]*?])(?![^\(]*?\)))/,$range); # commas outside of [] or ()
|
||||
if (scalar(@elems)==1) {
|
||||
@elems = split(/(@(?![^\(]*?\)))/,$range); # only split on @ when no , are present (inner recursion)
|
||||
}
|
||||
|
||||
while (my $atom = shift @elems) {
|
||||
if ($atom =~ /^-/) { # if this is an exclusion, strip off the minus, but remember it
|
||||
$atom = substr($atom,1);
|
||||
$op = $op."-";
|
||||
}
|
||||
|
||||
if ($atom =~ /^\^(.*)$/) { # get a list of nodes from a file
|
||||
open(NRF,$1);
|
||||
while (<NRF>) {
|
||||
my $line=$_;
|
||||
unless ($line =~ m/^[\^#]/) {
|
||||
$line =~ m/^([^: ]*)/;
|
||||
my $newrange = $1;
|
||||
chomp($newrange);
|
||||
$recurselevel++;
|
||||
my @filenodes = namerange($newrange);
|
||||
foreach (@filenodes) {
|
||||
$nodes{$_}=1;
|
||||
}
|
||||
}
|
||||
}
|
||||
close(NRF);
|
||||
next;
|
||||
}
|
||||
|
||||
my %newset = map { $_ =>1 } expandatom($atom); # expand the atom and make each entry in the resulting array a key in newset
|
||||
|
||||
if ($op =~ /@/) { # compute the intersection of the current atom and the node list we have received before this
|
||||
foreach (keys %nodes) {
|
||||
unless ($newset{$_}) {
|
||||
delete $nodes{$_};
|
||||
}
|
||||
}
|
||||
} elsif ($op =~ /,-/) { # add the nodes from this atom to the exclude list
|
||||
foreach (keys %newset) {
|
||||
$delnodes{$_}=1; #delay removal to end
|
||||
}
|
||||
} else { # add the nodes from this atom to the total node list
|
||||
foreach (keys %newset) {
|
||||
$nodes{$_}=1;
|
||||
}
|
||||
}
|
||||
$op = shift @elems;
|
||||
|
||||
} # end of main while loop
|
||||
|
||||
# Now remove all the exclusion nodes
|
||||
foreach (keys %nodes) {
|
||||
if ($delnodes{$_}) {
|
||||
delete $nodes{$_};
|
||||
}
|
||||
}
|
||||
if ($recurselevel) {
|
||||
$recurselevel--;
|
||||
}
|
||||
return sort (keys %nodes);
|
||||
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
xCAT::NameRange - Perl module for xCAT namerange expansion
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use xCAT::NameRange;
|
||||
my @nodes=namerange("storage@rack1,node[1-200],^/tmp/nodelist,node300-node400,node401+10,500-550");
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
namerange interprets xCAT noderange formatted strings and returns a list of
|
||||
names. The following two operations are supported on elements, and interpreted
|
||||
left to right:
|
||||
|
||||
, union next element with everything to the left.
|
||||
|
||||
@ take intersection of element to the right with everything on the left
|
||||
(i.e. mask out anything to the left not belonging to what is described to
|
||||
the right)
|
||||
|
||||
Each element can be a number of things:
|
||||
|
||||
A node name, i.e.:
|
||||
|
||||
=item * node1
|
||||
|
||||
A hyphenated node range (only one group of numbers may differ between the left and right hand side, and those numbers will increment in a base 10 fashion):
|
||||
|
||||
node1-node200 node1-compute-node200-compute
|
||||
node1:node200 node1-compute:node200-compute
|
||||
|
||||
A namerange denoted by brackets:
|
||||
|
||||
node[1-200] node[001-200]
|
||||
|
||||
A regular expression describing the namerange:
|
||||
|
||||
/d(1.?.?|200)
|
||||
|
||||
A node plus offset (this increments the first number found in nodename):
|
||||
|
||||
node1+199
|
||||
|
||||
And most of the above substituting groupnames.
|
||||
3C
|
||||
3C
|
||||
|
||||
NameRange tries to be intelligent about detecting padding, so you can:
|
||||
node001-node200
|
||||
And it will increment according to the pattern.
|
||||
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2007 IBM Corp. All rights reserved.
|
||||
|
||||
|
||||
=cut
|
||||
+8
-1744
File diff suppressed because it is too large
Load Diff
+31
-51
@@ -180,14 +180,7 @@ sub nodesbycriteria {
|
||||
return \%critnodes;
|
||||
}
|
||||
|
||||
# Expand one part of the noderange from the noderange() function. Initially, one part means the
|
||||
# substring between commas in the noderange. But expandatom also calls itself recursively to
|
||||
# further expand some parts.
|
||||
# Input args:
|
||||
# - atom to expand
|
||||
# - verify: whether or not to require that the resulting nodenames exist in the nodelist table
|
||||
# - options: genericrange - a purely syntactical expansion of the range, not using the db at all, e.g not expanding group names
|
||||
sub expandatom {
|
||||
sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels5.3)
|
||||
my $atom = shift;
|
||||
if ($recurselevel > 4096) { die "NodeRange seems to be hung on evaluating $atom, recursion limit hit"; }
|
||||
unless (scalar(@allnodeset) and (($allnodesetstamp+5) > time())) { #Build a cache of all nodes, some corner cases will perform worse, but by and large it will do better. We could do tests to see where the breaking points are, and predict how many atoms we have to evaluate to mitigate, for now, implement the strategy that keeps performance from going completely off the rails
|
||||
@@ -196,28 +189,25 @@ sub expandatom {
|
||||
@allnodeset = $nodelist->getAllAttribs('node','groups');
|
||||
%allnodehash = map { $_->{node} => 1 } @allnodeset;
|
||||
}
|
||||
my $verify = (scalar(@_) >= 1 ? shift : 1);
|
||||
my %options = @_; # additional options
|
||||
my $verify = (scalar(@_) == 1 ? shift : 1);
|
||||
my @nodes= ();
|
||||
#TODO: these env vars need to get passed by the client to xcatd
|
||||
my $nprefix=(defined ($ENV{'XCAT_NODE_PREFIX'}) ? $ENV{'XCAT_NODE_PREFIX'} : 'node');
|
||||
my $nsuffix=(defined ($ENV{'XCAT_NODE_SUFFIX'}) ? $ENV{'XCAT_NODE_SUFFIX'} : '');
|
||||
|
||||
if (not $options{genericrange} and $allnodehash{$atom}) { #The atom is a plain old nodename
|
||||
if ($allnodehash{$atom}) { #The atom is a plain old nodename
|
||||
return ($atom);
|
||||
}
|
||||
if ($atom =~ /^\(.*\)$/) { # handle parentheses by recursively calling noderange()
|
||||
$atom =~ s/^\((.*)\)$/$1/;
|
||||
$recurselevel++;
|
||||
return noderange($atom,$verify,1,%options);
|
||||
return noderange($atom);
|
||||
}
|
||||
if ($atom =~ /@/) {
|
||||
$recurselevel++;
|
||||
return noderange($atom,$verify,1,%options);
|
||||
return noderange($atom);
|
||||
}
|
||||
|
||||
# Try to match groups?
|
||||
unless ($options{genericrange}) {
|
||||
unless ($grptab) {
|
||||
$grptab = xCAT::Table->new('nodegroup');
|
||||
}
|
||||
@@ -279,9 +269,7 @@ sub expandatom {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# node selection based on db attribute values (nodetype.os==rhels5.3)
|
||||
if ($atom =~ m/[=~]/) { #TODO: this is the clunky, slow code path to acheive the goal. It also is the easiest to write, strange coincidence. Aggregating multiples would be nice
|
||||
my @nodes;
|
||||
foreach (@allnodeset) {
|
||||
@@ -299,7 +287,7 @@ sub expandatom {
|
||||
}
|
||||
if ($atom =~ m/^[0-9]+\z/) { # if only numbers, then add the prefix
|
||||
my $nodename=$nprefix.$atom.$nsuffix;
|
||||
return expandatom($nodename,$verify,%options);
|
||||
return expandatom($nodename,$verify);
|
||||
}
|
||||
my $nodelen=@nodes;
|
||||
if ($nodelen > 0) {
|
||||
@@ -307,7 +295,7 @@ sub expandatom {
|
||||
}
|
||||
|
||||
if ($atom =~ m/^\//) { # A regular expression
|
||||
if ($verify==0 or $options{genericrange}) { # If not in verify mode, regex makes zero possible sense
|
||||
unless ($verify) { # If not in verify mode, regex makes zero possible sense
|
||||
return ($atom);
|
||||
}
|
||||
#TODO: check against all groups
|
||||
@@ -321,29 +309,25 @@ sub expandatom {
|
||||
}
|
||||
|
||||
if ($atom =~ m/(.+?)\[(.+?)\](.*)/) { # square bracket range
|
||||
# if there is more than 1 set of [], we picked off just the 1st. If there more sets of [], we will expand
|
||||
# the 1st set and create a new set of atom by concatenating each result in the 1st expandsion with the rest
|
||||
# of the brackets. Then call expandatom() recursively on each new atom.
|
||||
my @subelems = split(/([\,\-\:])/,$2); # $2 is the range inside the 1st set of brackets
|
||||
# if there are more than 1 [], we picked off just the 1st. if there is another, we will process it later
|
||||
my @subelems = split(/([\,\-\:])/,$2);
|
||||
my $subrange="";
|
||||
my $subelem;
|
||||
my $start = $1; # the text before the 1st set of brackets
|
||||
my $ending = $3; # the text after the 1st set of brackets (could contain more brackets)
|
||||
my $morebrackets = $ending =~ /\[.+?\]/; # if there are more brackets, we have to expand just the 1st part, then add the 2nd part later
|
||||
while (scalar @subelems) { # this while loop turns something like a[1-3] into a1-a3 because another section of expand atom knows how to expand that
|
||||
my $subelem = shift @subelems;
|
||||
my $subelem;
|
||||
my $start = $1;
|
||||
my $ending = $3;
|
||||
my $morebrackets = $ending =~ /\[.+?\]/; # if there are more brackets, we have to expand just the 1st part, then add the 2nd part later
|
||||
while (scalar @subelems) {
|
||||
my $subelem = shift @subelems;
|
||||
my $subop=shift @subelems;
|
||||
$subrange=$subrange."$start$subelem" . ($morebrackets?'':$ending) . "$subop";
|
||||
}
|
||||
foreach (split /,/,$subrange) { # this foreach is in case there were commas inside the brackets originally, e.g.: a[1,3,5]b[1-2]
|
||||
# this expandatom just expands the part of the noderange that contains the 1st set of brackets
|
||||
# e.g. if noderange is a[1-2]b[1-2] it will create newnodes of a1 and a2
|
||||
my @newnodes=expandatom($_, ($morebrackets?0:$verify), genericrange=>($morebrackets||$options{genericrange}));
|
||||
foreach (split /,/,$subrange) {
|
||||
my @newnodes=expandatom($_, ($morebrackets?0:$verify));
|
||||
if (!$morebrackets) { push @nodes,@newnodes; }
|
||||
else {
|
||||
# for each of the new nodes (prefixes), add the rest of the brackets and then expand recursively
|
||||
# for each of the new nodes, add the 2nd brackets and then expand
|
||||
foreach my $n (@newnodes) {
|
||||
push @nodes, expandatom("$n$ending", $verify, %options);
|
||||
push @nodes, expandatom("$n$ending", $verify);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -365,7 +349,7 @@ sub expandatom {
|
||||
$suf=$nsuffix;
|
||||
}
|
||||
foreach ("$startnum".."$endnum") {
|
||||
my @addnodes=expandatom($pref.$_.$suf,$verify,%options);
|
||||
my @addnodes=expandatom($pref.$_.$suf,$verify);
|
||||
@nodes=(@nodes,@addnodes);
|
||||
}
|
||||
return (@nodes);
|
||||
@@ -392,7 +376,7 @@ sub expandatom {
|
||||
$right=$2;
|
||||
}
|
||||
if ($left eq $right) { #if they said node1-node1 for some strange reason
|
||||
return expandatom($left,$verify,%options);
|
||||
return expandatom($left,$verify);
|
||||
}
|
||||
my @leftarr=split(/(\d+)/,$left);
|
||||
my @rightarr=split(/(\d+)/,$right);
|
||||
@@ -429,7 +413,7 @@ sub expandatom {
|
||||
}
|
||||
}
|
||||
foreach ($leftarr[$idx]..$rightarr[$idx]) {
|
||||
my @addnodes=expandatom($prefix.$_.$luffix,$verify,%options);
|
||||
my @addnodes=expandatom($prefix.$_.$luffix,$verify);
|
||||
push @nodes,@addnodes;
|
||||
}
|
||||
return (@nodes); #the return has been built, return, exiting loop and all
|
||||
@@ -477,7 +461,7 @@ sub retain_cache { #A semi private operation to be used *ONLY* in the interestin
|
||||
%allgrphash=();
|
||||
}
|
||||
}
|
||||
sub extnoderange { #An extended noderange function. Needed by the GUI as the more straightforward function return format too simple for this.
|
||||
sub extnoderange { #An extended noderange function. Needed as the more straightforward function return format too simple for this.
|
||||
my $range = shift;
|
||||
my $namedopts = shift;
|
||||
my $verify=1;
|
||||
@@ -503,7 +487,7 @@ sub extnoderange { #An extended noderange function. Needed by the GUI as the mo
|
||||
return $return;
|
||||
}
|
||||
sub abbreviate_noderange {
|
||||
#takes a list of nodes or a string and reduces it by replacing a list of nodes that make up a group with the group name itself
|
||||
#takes a list of nodes or a string and abbreviates
|
||||
my $nodes=shift;
|
||||
my %grouphash;
|
||||
my %sizedgroups;
|
||||
@@ -549,20 +533,16 @@ sub abbreviate_noderange {
|
||||
return (join ',',keys %targetelems,keys %nodesleft);
|
||||
}
|
||||
|
||||
# Expand the given noderange
|
||||
# Input args:
|
||||
# - noderange to expand
|
||||
# - verify: whether or not to require that the resulting nodenames exist in the nodelist table
|
||||
# - exsitenode: whether or not to honor site.excludenodes to automatically exclude those nodes from all noderanges
|
||||
# - options: genericrange - a purely syntactical expansion of the range, not using the db at all, e.g not expanding group names
|
||||
sub noderange {
|
||||
$missingnodes=[];
|
||||
#We for now just do left to right operations
|
||||
my $range=shift;
|
||||
$range =~ s/['"]//g;
|
||||
my $verify = (scalar(@_) >= 1 ? shift : 1);
|
||||
my $exsitenode = (scalar(@_) >= 1 ? shift : 1); # if 1, honor site.excludenodes
|
||||
my %options = @_; # additional options
|
||||
|
||||
#excludenodes attribute in site table,
|
||||
#these nodes should be excluded for any xCAT commands
|
||||
my $exsitenode = (scalar(@_) >= 1 ? shift : 1);
|
||||
|
||||
unless ($nodelist) {
|
||||
$nodelist =xCAT::Table->new('nodelist',-create =>1);
|
||||
@@ -597,7 +577,7 @@ sub noderange {
|
||||
my $newrange = $1;
|
||||
chomp($newrange);
|
||||
$recurselevel++;
|
||||
my @filenodes = noderange($newrange,$verify,$exsitenode,%options);
|
||||
my @filenodes = noderange($newrange);
|
||||
foreach (@filenodes) {
|
||||
$nodes{$_}=1;
|
||||
}
|
||||
@@ -607,7 +587,7 @@ sub noderange {
|
||||
next;
|
||||
}
|
||||
|
||||
my %newset = map { $_ =>1 } expandatom($atom,$verify,%options); # expand the atom and make each entry in the resulting array a key in newset
|
||||
my %newset = map { $_ =>1 } expandatom($atom,$verify); # expand the atom and make each entry in the resulting array a key in newset
|
||||
|
||||
if ($op =~ /@/) { # compute the intersection of the current atom and the node list we have received before this
|
||||
foreach (keys %nodes) {
|
||||
@@ -634,7 +614,7 @@ sub noderange {
|
||||
my $badnoderange = 0;
|
||||
my @badnodes = ();
|
||||
if ($::XCATSITEVALS{excludenodes}) {
|
||||
@badnodes = noderange($::XCATSITEVALS{excludenodes}, 1, 0, %options);
|
||||
@badnodes = noderange($::XCATSITEVALS{excludenodes}, 1, 0);
|
||||
foreach my $bnode (@badnodes) {
|
||||
if (!$delnodes{$bnode}) {
|
||||
$delnodes{$bnode} = 1;
|
||||
|
||||
@@ -8,7 +8,6 @@ use Getopt::Long;
|
||||
use xCAT::PPCcli qw(SUCCESS EXPECT_ERROR RC_ERROR NR_ERROR);
|
||||
use xCAT::Usage;
|
||||
use xCAT::Utils;
|
||||
use xCAT::TableUtils;
|
||||
use xCAT::MsgUtils;
|
||||
use xCAT::LparNetbootExp;
|
||||
|
||||
@@ -468,12 +467,9 @@ sub rnetboot {
|
||||
}
|
||||
}
|
||||
|
||||
#my $sitetab = xCAT::Table->new('site');
|
||||
#my $vcon = $sitetab->getAttribs({key => "conserverondemand"}, 'value');
|
||||
my @vcons = xCAT::TableUtils->get_site_attribute("conserverondemand");
|
||||
my $vcon = $vcons[0];
|
||||
#if ($vcon and $vcon->{"value"} and $vcon->{"value"} eq "yes" ) {
|
||||
if ( defined($vcon) and $vcon eq "yes" ) {
|
||||
my $sitetab = xCAT::Table->new('site');
|
||||
my $vcon = $sitetab->getAttribs({key => "conserverondemand"}, 'value');
|
||||
if ($vcon and $vcon->{"value"} and $vcon->{"value"} eq "yes" ) {
|
||||
$result = xCAT::PPCcli::lpar_netboot(
|
||||
$exp,
|
||||
$request->{verbose},
|
||||
@@ -486,7 +482,7 @@ sub rnetboot {
|
||||
#########################################
|
||||
$result = do_rnetboot( $request, $d, $exp, $name, $node, \%opt );
|
||||
}
|
||||
#$sitetab->close;
|
||||
$sitetab->close;
|
||||
|
||||
if (defined($request->{opt}->{m})) {
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ use xCAT::PPCfsp;
|
||||
use xCAT::Usage;
|
||||
use Storable qw(freeze thaw);
|
||||
use POSIX "WNOHANG";
|
||||
use xCAT::NetworkUtils;
|
||||
use xCAT::MsgUtils qw(verbose_message);
|
||||
|
||||
use LWP;
|
||||
@@ -738,7 +737,7 @@ sub doresetnet {
|
||||
$nodetype = ( $nodetype =~ /^frame$/i ) ? "bpa" : "fsp";
|
||||
if ($cnodep) {
|
||||
foreach my $cnode (@$cnodep) {
|
||||
my $ip = xCAT::NetworkUtils::getNodeIPaddress( $cnode );
|
||||
my $ip = xCAT::Utils::getNodeIPaddress( $cnode );
|
||||
my $oi = $oihash{$cnode};
|
||||
if(!defined $ip) {
|
||||
send_msg($req, "doresetnet: can't get $cnode ip");
|
||||
@@ -787,7 +786,7 @@ sub doresetnet {
|
||||
# this brunch is just for the xcat 2.5(or 2.5-) databse
|
||||
} elsif ( $nodetype =~ /^(fsp|bpa)$/ ) {
|
||||
foreach my $nn ( @{ $req->{node}} ) {
|
||||
my $ip = xCAT::NetworkUtils::getNodeIPaddress( $nn );
|
||||
my $ip = xCAT::Utils::getNodeIPaddress( $nn );
|
||||
if(!defined $ip) {
|
||||
send_msg($req, "doresetnet: can't get $nn ip");
|
||||
next;
|
||||
@@ -1048,7 +1047,6 @@ sub child_process {
|
||||
}
|
||||
my $msg = "login result is :".join(',', @exp);
|
||||
xCAT::MsgUtils->verbose_message( $req, $msg);
|
||||
|
||||
####################################
|
||||
# do resetnet
|
||||
####################################
|
||||
@@ -1432,3 +1430,4 @@ sub connect {
|
||||
|
||||
1;
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ require Exporter;
|
||||
our @ISA = qw(Exporter);
|
||||
our @EXPORT_OK = qw(SUCCESS RC_ERROR EXPECT_ERROR NR_ERROR);
|
||||
use Expect;
|
||||
use xCAT::NetworkUtils;
|
||||
|
||||
|
||||
#############################################
|
||||
# Removes Ctrl characters from term output
|
||||
@@ -1335,7 +1335,7 @@ sub getHMCcontrolIP
|
||||
#my @newnodes = split(/,/, $nodes_found->[0]);
|
||||
#$Rc = shift(@newnodes);
|
||||
#for my $entry (@newnodes) {
|
||||
# if(xCAT::NetworkUtils->isIpaddr($entry)) {
|
||||
# if(xCAT::Utils->isIpaddr($entry)) {
|
||||
# push @ips,$entry;
|
||||
# }
|
||||
# $ip_result = join( ",", @ips );
|
||||
|
||||
+13
-35
@@ -5,10 +5,9 @@ use strict;
|
||||
use Getopt::Long;
|
||||
use xCAT::PPCcli qw(SUCCESS EXPECT_ERROR RC_ERROR NR_ERROR);
|
||||
use xCAT::Usage;
|
||||
use xCAT::NetworkUtils;
|
||||
use xCAT::DBobjUtils;
|
||||
use xCAT::FSPUtils;
|
||||
use xCAT::MsgUtils qw(verbose_message);
|
||||
|
||||
##############################################
|
||||
# Globals
|
||||
##############################################
|
||||
@@ -99,7 +98,7 @@ sub mkhwconn_parse_args
|
||||
#my $nodetype_hash = $nodetypetab->getNodeAttribs( $node,[qw(nodetype)]);
|
||||
my $node_parent_hash = $ppctab->getNodeAttribs( $node,[qw(parent)]);
|
||||
#$nodetype = $nodetype_hash->{nodetype};
|
||||
$nodetype = xCAT::DBobjUtils->getnodetype($node,"ppc");
|
||||
$nodetype = xCAT::DBobjUtils->getnodetype($node);
|
||||
$node_parent = $node_parent_hash->{parent};
|
||||
if ( !$nodetype )
|
||||
{
|
||||
@@ -107,7 +106,7 @@ sub mkhwconn_parse_args
|
||||
next;
|
||||
} else
|
||||
{
|
||||
unless ( $nodetype =~ /^(blade|fsp|bpa|frame|cec|hmc)$/)
|
||||
unless ( $nodetype =~ /^(fsp|bpa|frame|cec|hmc)$/)
|
||||
{
|
||||
return ( usage("Node type is incorrect. \n"));
|
||||
}
|
||||
@@ -474,7 +473,6 @@ sub mkhwconn
|
||||
my @value = ();
|
||||
my $Rc = undef;
|
||||
|
||||
xCAT::MsgUtils->verbose_message($request, "mkhwconn START.");
|
||||
for my $cec_bpa ( keys %$hash)
|
||||
{
|
||||
my $node_hash = $hash->{$cec_bpa};
|
||||
@@ -486,13 +484,9 @@ sub mkhwconn
|
||||
# Get IP address
|
||||
############################
|
||||
my $cnode;
|
||||
#my $ntype = xCAT::DBobjUtils::getnodetype($node_name);
|
||||
my $ntype = $$d[4];
|
||||
if ($ntype =~ /^(cec|frame|blade)$/)
|
||||
my $ntype = xCAT::DBobjUtils::getnodetype($node_name);
|
||||
if ($ntype =~ /^(cec|frame)$/)
|
||||
{
|
||||
if ($ntype eq "blade") {
|
||||
delete $opt->{port};
|
||||
}
|
||||
$cnode = xCAT::DBobjUtils::getchildren($node_name, $opt->{port});
|
||||
} else {
|
||||
$cnode = $node_name;
|
||||
@@ -507,12 +501,11 @@ sub mkhwconn
|
||||
} else {
|
||||
push @newnodes,$cnode;
|
||||
}
|
||||
xCAT::MsgUtils->verbose_message($request, "mkhwconn :mksysconn for node:$node_name.");
|
||||
for my $nn ( @newnodes )
|
||||
{
|
||||
my $node_ip;
|
||||
unless ( xCAT::NetworkUtils->isIpaddr($nn) ) {
|
||||
$node_ip = xCAT::NetworkUtils::getNodeIPaddress( $nn );
|
||||
unless ( xCAT::Utils->isIpaddr($nn) ) {
|
||||
$node_ip = xCAT::Utils::getNodeIPaddress( $nn );
|
||||
} else {
|
||||
$node_ip = $nn;
|
||||
}
|
||||
@@ -522,17 +515,12 @@ sub mkhwconn
|
||||
next;
|
||||
}
|
||||
|
||||
my ( undef,undef,$mtms,undef,$type,$bpa) = @$d;
|
||||
my ( undef,undef,$mtms,undef,$type) = @$d;
|
||||
my ($user, $passwd);
|
||||
if ( exists $opt->{P})
|
||||
{
|
||||
($user, $passwd) = ('HMC', $opt->{P});
|
||||
}
|
||||
elsif ($type eq "blade") {
|
||||
$user = "USERID";
|
||||
($user, $passwd) = xCAT::PPCdb::credentials( $bpa, $type, $user);
|
||||
$type = "cec";
|
||||
}
|
||||
else
|
||||
{
|
||||
($user, $passwd) = xCAT::PPCdb::credentials( $node_name, $type,'HMC');
|
||||
@@ -561,7 +549,6 @@ sub mkhwconn
|
||||
# }
|
||||
}
|
||||
}
|
||||
xCAT::MsgUtils->verbose_message($request, "mkhwconn END.");
|
||||
return \@value;
|
||||
}
|
||||
##########################################################################
|
||||
@@ -652,7 +639,7 @@ sub lshwconn
|
||||
{
|
||||
#my $node_ip_hash = $hosttab->getNodeAttribs( $node_name,[qw(ip)]);
|
||||
#$node_ip = $node_ip_hash->{ip};
|
||||
#$node_ip = xCAT::NetworkUtils::getNodeIPaddress( $node_name );
|
||||
#$node_ip = xCAT::Utils::getNodeIPaddress( $node_name );
|
||||
my $d = $node_hash->{$node_name};
|
||||
$node_ip = xCAT::FSPUtils::getIPaddress($request, $$d[4], $node_name );
|
||||
}
|
||||
@@ -716,7 +703,7 @@ sub rmhwconn
|
||||
my $d = $node_hash->{$node_name};
|
||||
|
||||
my ( undef,undef,undef,undef,$type) = @$d;
|
||||
if ($type eq "blade") {$type = "cec";}
|
||||
|
||||
############################
|
||||
# Get IP address
|
||||
############################
|
||||
@@ -733,19 +720,10 @@ sub rmhwconn
|
||||
|
||||
my @ips;
|
||||
foreach my $entry ( @$nodes_found ) {
|
||||
if ($entry =~ /type_model_serial_num=([^,]*),/) {
|
||||
my $match_mtm1 = $1;
|
||||
my $match_mtm2 = $match_mtm1;
|
||||
$match_mtm2 =~ s/\-//;
|
||||
if ($match_mtm1 =~ /$mtm\*$serial/ || $match_mtm2 =~ /$mtm\*$serial/) {
|
||||
$entry =~ /ipaddr=(\d+\.\d+\.\d+\.\d+),/;
|
||||
push @ips, $1;
|
||||
}
|
||||
if ( $entry =~ /$mtm\*$serial/) {
|
||||
$entry =~ /ipaddr=(\d+\.\d+\.\d+\.\d+),/;
|
||||
push @ips, $1;
|
||||
}
|
||||
#if ( $entry =~ /$mtm\*$serial/) {
|
||||
# $entry =~ /ipaddr=(\d+\.\d+\.\d+\.\d+),/;
|
||||
# push @ips, $1;
|
||||
#}
|
||||
}
|
||||
if (!@ips)
|
||||
{
|
||||
|
||||
+8
-10
@@ -4,9 +4,7 @@ package xCAT::PPCdb;
|
||||
use strict;
|
||||
use xCAT::Table;
|
||||
use xCAT::GlobalDef;
|
||||
use xCAT::Utils;
|
||||
use xCAT::TableUtils;
|
||||
use xCAT::NetworkUtils;
|
||||
|
||||
|
||||
###########################################
|
||||
# Factory defaults
|
||||
@@ -949,7 +947,7 @@ sub get_host {
|
||||
#######################################
|
||||
if ($ip)
|
||||
{
|
||||
my $nets = xCAT::NetworkUtils::my_nets();
|
||||
my $nets = xCAT::Utils::my_nets();
|
||||
my $avip = getip_from_iplist( $ip, $nets);
|
||||
#if ( !defined( $ip )) {
|
||||
# return undef;
|
||||
@@ -986,7 +984,7 @@ sub get_host {
|
||||
}
|
||||
|
||||
if ( $tmpmtm eq $mtm and $tmpsn eq $sn) {
|
||||
my $ifip = xCAT::NetworkUtils->isIpaddr($oldnode);
|
||||
my $ifip = xCAT::Utils->isIpaddr($oldnode);
|
||||
if ( $ifip ) {# which means that the node is defined by the new lsslp
|
||||
if ( $tmpside eq $side ) {# match! which means that node is the same as the new one
|
||||
if ( $ip eq $tmpip ) { #which means that the ip is not changed
|
||||
@@ -1106,7 +1104,7 @@ sub get_host {
|
||||
}
|
||||
|
||||
# not matched, use the new name
|
||||
my $ifip = xCAT::NetworkUtils->isIpaddr($nodename);
|
||||
my $ifip = xCAT::Utils->isIpaddr($nodename);
|
||||
unless ($ifip) {
|
||||
return $nodename;
|
||||
}else {
|
||||
@@ -1152,8 +1150,8 @@ sub getip_from_iplist
|
||||
for my $net ( keys %$nets)
|
||||
{
|
||||
my ($n,$m) = split /\//,$net;
|
||||
if ( xCAT::NetworkUtils::isInSameSubnet( $n, $ip, $m, 1) and
|
||||
xCAT::NetworkUtils::isPingable( $ip))
|
||||
if ( xCAT::Utils::isInSameSubnet( $n, $ip, $m, 1) and
|
||||
xCAT::Utils::isPingable( $ip))
|
||||
{
|
||||
return $ip;
|
||||
}
|
||||
@@ -1167,7 +1165,7 @@ sub read_from_table {
|
||||
my %typehash;
|
||||
my %iphash;
|
||||
my %vpdhash;
|
||||
if ( !(%::OLD_DATA_CACHE))
|
||||
if ( !defined(%::OLD_DATA_CACHE))
|
||||
{
|
||||
# find out all the existed nodes' ipaddresses
|
||||
my $hoststab = xCAT::Table->new('hosts');
|
||||
@@ -1213,7 +1211,7 @@ sub read_from_table {
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[1] = @{$vpdhash{$entry->{node}}}[1];#sn
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[2] = @{$vpdhash{$entry->{node}}}[2];#side
|
||||
# find node ip address, check node name first, then check hosts table
|
||||
my $ifip = xCAT::NetworkUtils->isIpaddr($entry->{node});
|
||||
my $ifip = xCAT::Utils->isIpaddr($entry->{node});
|
||||
if ( $ifip )
|
||||
{
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[3] = $entry->{node};#ip
|
||||
|
||||
+25
-89
@@ -2,19 +2,13 @@
|
||||
|
||||
package xCAT::PPCenergy;
|
||||
|
||||
BEGIN
|
||||
{
|
||||
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
|
||||
}
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
|
||||
use strict;
|
||||
use Getopt::Long;
|
||||
use xCAT::Usage;
|
||||
use xCAT::NodeRange;
|
||||
use xCAT::DBobjUtils;
|
||||
use xCAT::FSPUtils;
|
||||
use xCAT::TableUtils qw(get_site_Master);
|
||||
|
||||
%::QUERY_ATTRS = (
|
||||
'savingstatus' => 1,
|
||||
'dsavingstatus' => 1,
|
||||
@@ -257,7 +251,7 @@ sub renergy {
|
||||
if( !defined($fsps) ) {
|
||||
return ([[$node, "Failed to get the FSPs for the cec $hcphost.", -1]]);
|
||||
}
|
||||
#my $hcp_ip = xCAT::NetworkUtils::getNodeIPaddress($hcphost);
|
||||
#my $hcp_ip = xCAT::Utils::getNodeIPaddress($hcphost);
|
||||
my $hcp_ip = xCAT::FSPUtils::getIPaddress($request, $hw_type, $hcphost);
|
||||
if (!defined($hcp_ip) or ($hcp_ip == -3)) {
|
||||
return ([[$node, "Failed to get IP address for $hcphost.", -1]]);
|
||||
@@ -270,7 +264,7 @@ sub renergy {
|
||||
}
|
||||
} else {
|
||||
# for the case that hcp is hmc or fsp
|
||||
push @hcps_ip, xCAT::NetworkUtils::getNodeIPaddress($hcphost);
|
||||
push @hcps_ip, xCAT::Utils::getNodeIPaddress($hcphost);
|
||||
}
|
||||
|
||||
if (!$user || !$password) {
|
||||
@@ -285,80 +279,28 @@ sub renergy {
|
||||
}
|
||||
$verbose = $tmpv;
|
||||
|
||||
my @pingable_hcp;
|
||||
if (-x '/usr/bin/nmap' or -x '/usr/local/bin/nmap') { #use nmap
|
||||
#print "use nmap\n";
|
||||
if ($verbose) {
|
||||
push @return_msg, [$node, "Checking ping status using nmap for @hcps_ip", 0];
|
||||
}
|
||||
my %deadnodes;
|
||||
foreach (@hcps_ip) {
|
||||
$deadnodes{$_}=1;
|
||||
}
|
||||
open (NMAP, "nmap -PE --system-dns --send-ip -sP ". join(' ',@hcps_ip) . " 2> /dev/null|") or die("Cannot open nmap pipe: $!");
|
||||
my $node1;
|
||||
my $msg1;
|
||||
while (<NMAP>) {
|
||||
#print "$_\n";
|
||||
if (/Host (.*) \((.*)\) appears to be up/) {
|
||||
$node1=$2;
|
||||
unless ($deadnodes{$node1}) {
|
||||
foreach (keys %deadnodes) {
|
||||
if ($node1 =~ /^$_\./) {
|
||||
$node1 = $_;
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
delete $deadnodes{$node1};
|
||||
if ($verbose) {
|
||||
push @return_msg, [$node, $_, 0];
|
||||
}
|
||||
push(@pingable_hcp, $node1);
|
||||
} elsif (/Nmap scan report for ([^ ]*) \((.*)\)/) {
|
||||
$node1=$2;
|
||||
$msg1=$_;
|
||||
} elsif (/Host is up./) {
|
||||
unless ($deadnodes{$node1}) {
|
||||
foreach (keys %deadnodes) {
|
||||
if ($node1 =~ /^$_\./) {
|
||||
$node1 = $_;
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
delete $deadnodes{$node1};
|
||||
if ($verbose) {
|
||||
push @return_msg, [$node, "$msg1$_", 0];
|
||||
}
|
||||
push(@pingable_hcp, $node1);
|
||||
}
|
||||
}
|
||||
my $master = xCAT::Utils->get_site_Master();
|
||||
my $masterip = xCAT::NetworkUtils->getipaddr($master);
|
||||
if ($masterip =~ /:/) { #IPv6, needs fping6 support
|
||||
if (!-x '/usr/bin/fping6')
|
||||
{
|
||||
push @return_msg, [$node, "fping6 is not availabe for IPv6 ping.", -1];
|
||||
return \@return_msg;
|
||||
}
|
||||
open (FPING, "fping6 ".join(' ',@hcps_ip). " 2>&1 |") or die("Cannot open fping pipe: $!");
|
||||
} else {
|
||||
#use fping
|
||||
#print "use fping\n";
|
||||
my $master = xCAT::TableUtils->get_site_Master();
|
||||
my $masterip = xCAT::NetworkUtils->getipaddr($master);
|
||||
if ($masterip =~ /:/) { #IPv6, needs fping6 support
|
||||
if (!-x '/usr/bin/fping6')
|
||||
{
|
||||
push @return_msg, [$node, "fping6 is not availabe for IPv6 ping.", -1];
|
||||
return \@return_msg;
|
||||
}
|
||||
open (FPING, "fping6 ".join(' ',@hcps_ip). " 2>&1 |") or die("Cannot open fping pipe: $!");
|
||||
} else {
|
||||
open (FPING, "fping ".join(' ',@hcps_ip). " 2>&1 |") or die("Cannot open fping pipe: $!");
|
||||
}
|
||||
|
||||
while (<FPING>) {
|
||||
if ($verbose) {
|
||||
push @return_msg, [$node, $_, 0];
|
||||
}
|
||||
if ($_ =~ /is alive/) {
|
||||
s/ is alive//;
|
||||
push @pingable_hcp, $_;
|
||||
}
|
||||
}
|
||||
open (FPING, "fping ".join(' ',@hcps_ip). " 2>&1 |") or die("Cannot open fping pipe: $!");
|
||||
}
|
||||
|
||||
my @pingable_hcp;
|
||||
while (<FPING>) {
|
||||
if ($verbose) {
|
||||
push @return_msg, [$node, $_, 0];
|
||||
}
|
||||
if ($_ =~ /is alive/) {
|
||||
s/ is alive//;
|
||||
push @pingable_hcp, $_;
|
||||
}
|
||||
}
|
||||
|
||||
if (!@pingable_hcp) {
|
||||
@@ -377,23 +319,17 @@ sub renergy {
|
||||
# Generate the url path for CIM communication
|
||||
chomp($hcp);
|
||||
my $url_path = "https://"."$user".":"."$password"."\@"."$hcp".":5989";
|
||||
|
||||
# Not display password in command outupt.
|
||||
my $display_url_path = "https://"."$user".":"."xxxxxx"."\@"."$hcp".":5989";
|
||||
|
||||
# Execute the request
|
||||
my $cmd = "";
|
||||
my $display_cmd = "";
|
||||
if ($opt->{'set'}) {
|
||||
$cmd = "$::CIM_CLIENT_PATH $verb_arg -u $url_path -n $cec_name -o $opt->{'set'}";
|
||||
$display_cmd = "$::CIM_CLIENT_PATH $verb_arg -u $display_url_path -n $cec_name -o $opt->{'set'}";
|
||||
} elsif ($opt->{'query'}) {
|
||||
$cmd = "$::CIM_CLIENT_PATH $verb_arg -u $url_path -n $cec_name -o $opt->{'query'}";
|
||||
$display_cmd = "$::CIM_CLIENT_PATH $verb_arg -u $display_url_path -n $cec_name -o $opt->{'query'}";
|
||||
}
|
||||
|
||||
if ($verbose) {
|
||||
push @noerr_msg, [$node, "Run following command: $display_cmd", 0];
|
||||
push @noerr_msg, [$node, "Run following command: $cmd", 0];
|
||||
}
|
||||
|
||||
# Disable the CHID signal before run the command. Otherwise the
|
||||
|
||||
@@ -12,7 +12,6 @@ use Socket;
|
||||
use xCAT::PPCdb;
|
||||
use xCAT::MsgUtils qw(verbose_message);
|
||||
use xCAT::Utils;
|
||||
use xCAT::TableUtils;
|
||||
use xCAT::NetworkUtils;
|
||||
##########################################
|
||||
# Globals
|
||||
@@ -78,7 +77,7 @@ sub handler {
|
||||
# Disconnect from FSP
|
||||
#####################################
|
||||
unless ($flag) {
|
||||
xCAT::PPCfsp::disconnect( $exp );
|
||||
xCAT::PPCfsp::disconnect( $exp );
|
||||
}
|
||||
return( \@outhash );
|
||||
|
||||
@@ -1914,7 +1913,7 @@ sub set_netcfg
|
||||
elsif ( $inc_ip eq '*')
|
||||
{
|
||||
$inc_type = 'Static';
|
||||
($inc_ip, $inc_host, $inc_gateway, $inc_netmask) = xCAT::NetworkUtils::getNodeNetworkCfg(@$exp[1]);
|
||||
($inc_ip, $inc_host, $inc_gateway, $inc_netmask) = xCAT::Utils::getNodeNetworkCfg(@$exp[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -59,7 +59,7 @@ sub parse_args {
|
||||
$Getopt::Long::ignorecase = 0;
|
||||
Getopt::Long::Configure( "bundling" );
|
||||
|
||||
if ( !GetOptions( \%opt, qw(V|verbose) )) {
|
||||
if ( !GetOptions( \%opt, qw(V|Verbose) )) {
|
||||
return( usage() );
|
||||
}
|
||||
####################################
|
||||
|
||||
@@ -6,11 +6,8 @@ use strict;
|
||||
use Getopt::Long;
|
||||
use Data::Dumper;
|
||||
use xCAT::PPCcli qw(SUCCESS EXPECT_ERROR RC_ERROR NR_ERROR);
|
||||
use xCAT::Utils;
|
||||
use xCAT::TableUtils;
|
||||
use xCAT::ServiceNodeUtils;
|
||||
use xCAT::NetworkUtils;
|
||||
use xCAT::MsgUtils qw(verbose_message);
|
||||
|
||||
use xCAT::LparNetbootExp;
|
||||
|
||||
##########################################################################
|
||||
@@ -49,7 +46,7 @@ sub parse_args {
|
||||
$Getopt::Long::ignorecase = 0;
|
||||
Getopt::Long::Configure( "bundling" );
|
||||
|
||||
if ( !GetOptions( \%opt,qw(h|help V|verbose v|version C=s G=s S=s D d f M o F=s arp))) {
|
||||
if ( !GetOptions( \%opt,qw(h|help V|Verbose v|version C=s G=s S=s D d f M o F=s arp))) {
|
||||
return( usage() );
|
||||
}
|
||||
####################################
|
||||
@@ -77,15 +74,6 @@ sub parse_args {
|
||||
return(usage( "Invalid Argument: $ARGV[0]" ));
|
||||
}
|
||||
####################################
|
||||
# Check -o argument
|
||||
####################################
|
||||
if ( exists($opt{o}) ) {
|
||||
unless (exists($opt{D})){
|
||||
return(usage( "The -o flag must be used with -D flag" ));
|
||||
}
|
||||
|
||||
}
|
||||
####################################
|
||||
# Check argument for ping test
|
||||
####################################
|
||||
if ( exists($opt{D}) ) {
|
||||
@@ -102,9 +90,9 @@ sub parse_args {
|
||||
if ( exists($opt{S}) ) {
|
||||
push @network, $_;
|
||||
} else {
|
||||
$server = xCAT::ServiceNodeUtils->getSNformattedhash( $node, "xcat", "node", "primary" );
|
||||
$server = xCAT::Utils->getSNformattedhash( $node, "xcat", "node", "primary" );
|
||||
foreach my $key ( keys %$server ) {
|
||||
my $valid_ip = xCAT::NetworkUtils->validate_ip( $key );
|
||||
my $valid_ip = xCAT::Utils->validate_ip( $key );
|
||||
if ( $valid_ip ) {
|
||||
###################################################
|
||||
# Service node is returned as hostname, Convert
|
||||
@@ -209,7 +197,7 @@ sub parse_args {
|
||||
if ( scalar(@network) != 3 ) {
|
||||
return( usage() );
|
||||
}
|
||||
my $result = xCAT::NetworkUtils->validate_ip( $opt{C}, $opt{G}, $opt{S} );
|
||||
my $result = xCAT::Utils->validate_ip( $opt{C}, $opt{G}, $opt{S} );
|
||||
if ( @$result[0] ) {
|
||||
return(usage( @$result[1] ));
|
||||
}
|
||||
@@ -406,7 +394,6 @@ sub do_getmacs {
|
||||
# last;
|
||||
# }
|
||||
#}
|
||||
xCAT::MsgUtils->verbose_message($request, "getmacs :lparnetbootexp for node:$node.");
|
||||
my $Rc = xCAT::LparNetbootExp->lparnetbootexp(\%optarg, $request);
|
||||
######################################
|
||||
# Split results into array
|
||||
@@ -644,7 +631,6 @@ sub getmacs {
|
||||
#########################################
|
||||
# Connect to fsp to achieve MAC address
|
||||
#########################################
|
||||
xCAT::MsgUtils->verbose_message($request, "getmacs START.");
|
||||
my $d = $par;
|
||||
|
||||
#########################################
|
||||
@@ -665,7 +651,6 @@ sub getmacs {
|
||||
# Get name known by HCP
|
||||
#########################################
|
||||
my $filter = "name,lpar_id";
|
||||
xCAT::MsgUtils->verbose_message($request, "getmacs :lssyscfg filter '$filter'.");
|
||||
my $values = xCAT::PPCcli::lssyscfg( $exp, $type, $mtms, $filter );
|
||||
my $Rc = shift(@$values);
|
||||
|
||||
@@ -691,14 +676,9 @@ sub getmacs {
|
||||
return( [[$node,"Node not found, lparid=$lparid",RC_ERROR]] );
|
||||
}
|
||||
|
||||
#my $sitetab = xCAT::Table->new('site');
|
||||
#my $vcon = $sitetab->getAttribs({key => "conserverondemand"}, 'value');
|
||||
#there may be something wrong with the conserverondemand attribute.
|
||||
# Currently, the code is not used. So not fix this time. Just keep it here.
|
||||
my @vcons = xCAT::TableUtils->get_site_attribute("conserverondemand");
|
||||
my $vcon = $vcons[0];
|
||||
#if ($vcon and $vcon->{"value"} and $vcon->{"value"} eq "yes" ) {
|
||||
if ( defined($vcon) and $vcon eq "yes" ) {
|
||||
my $sitetab = xCAT::Table->new('site');
|
||||
my $vcon = $sitetab->getAttribs({key => "conserverondemand"}, 'value');
|
||||
if ($vcon and $vcon->{"value"} and $vcon->{"value"} eq "yes" ) {
|
||||
$result = xCAT::PPCcli::lpar_netboot(
|
||||
$exp,
|
||||
$request->{verbose},
|
||||
@@ -709,11 +689,10 @@ sub getmacs {
|
||||
#########################################
|
||||
# Manually collect MAC addresses.
|
||||
#########################################
|
||||
xCAT::MsgUtils->verbose_message($request, "getmacs :do_getmacs for node:$node.");
|
||||
$result = do_getmacs( $request, $d, $exp, $name, $node );
|
||||
$Rc = shift(@$result);
|
||||
}
|
||||
#$sitetab->close;
|
||||
$sitetab->close;
|
||||
|
||||
|
||||
##################################
|
||||
@@ -765,7 +744,6 @@ sub getmacs {
|
||||
if ( !exists( $opt->{d} )) {
|
||||
writemac( $node, $result );
|
||||
}
|
||||
xCAT::MsgUtils->verbose_message($request, "getmacs END.");
|
||||
return( [[$node,$data,$Rc]] );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ sub parse_args {
|
||||
$Getopt::Long::ignorecase = 0;
|
||||
Getopt::Long::Configure( "bundling" );
|
||||
|
||||
if ( !GetOptions( \%opt, qw(V|verbose m:s@ t=s T=s r=s nodeps) )) {
|
||||
if ( !GetOptions( \%opt, qw(V|Verbose m:s@ t=s T=s r=s nodeps) )) {
|
||||
return( usage() );
|
||||
}
|
||||
####################################
|
||||
|
||||
+17
-22
@@ -8,8 +8,6 @@ use xCAT::Usage;
|
||||
use xCAT::PPCinv;
|
||||
use xCAT::DSHCLI;
|
||||
use xCAT::Table;
|
||||
use xCAT::Utils;
|
||||
use xCAT::TableUtils;
|
||||
use Getopt::Long;
|
||||
use File::Spec;
|
||||
use POSIX qw(tmpnam);
|
||||
@@ -51,6 +49,7 @@ sub parse_args {
|
||||
my %opt = ();
|
||||
my $cmd = $request->{command};
|
||||
my $args = $request->{arg};
|
||||
|
||||
#############################################
|
||||
# Change CEC/Frame node into FSPs/BPAs
|
||||
#############################################
|
||||
@@ -158,15 +157,15 @@ sub parse_args {
|
||||
#--activate's value only can be concurrent and disruptive
|
||||
################################
|
||||
if(exists($opt{activate})) {
|
||||
if (defined($request->{mgt}) && $request->{mgt} =~ /xCAT::FSP/i) {
|
||||
if ($opt{activate} !~ /deferred|disruptive/) {
|
||||
return (usage("--activate's value can only be deferred or disruptive."));
|
||||
if (defined($request->{mgt}) && ($request->{mgt} =~ /xCAT::FSP/i)) {
|
||||
if (($opt{activate} ne "deferred") && ($opt{activate} ne "disruptive")) {
|
||||
return (usage("--activate's value can only be deferred or disruptive"));
|
||||
}
|
||||
} else {
|
||||
if(($opt{activate} ne "disruptive") && ($opt{activate} ne "concurrent")) {
|
||||
return (usage("--activate's value can only be disruptive or concurrent."));
|
||||
if( ($opt{activate} ne "concurrent") && ($opt{activate} ne "disruptive")) {
|
||||
return (usage("--activate's value can only be disruptive or concurrent"));
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!exists( $opt{d} )) {
|
||||
$opt{d} = "/tmp";
|
||||
}
|
||||
@@ -326,7 +325,7 @@ sub preprocess_for_rflash {
|
||||
my $request = shift;
|
||||
my $opt = shift;
|
||||
my $callback = $request->{callback};
|
||||
my $install_dir = xCAT::TableUtils->getInstallDir();
|
||||
my $install_dir = xCAT::Utils->getInstallDir();
|
||||
my $packages_fw = "$install_dir/packages_fw";
|
||||
my $c = 0;
|
||||
my $packages_d;
|
||||
@@ -534,22 +533,18 @@ sub get_lic_filenames {
|
||||
#############
|
||||
if($fff ne $2) {
|
||||
$upgrade_required = 1;
|
||||
if($activate ne "disruptive") {
|
||||
$msg = "Option --activate's value should be disruptive";
|
||||
return ("", "","", $msg, -1);
|
||||
}
|
||||
} else {
|
||||
|
||||
if(($pns eq $1) && ($3 > $active_level) &&($4 <= $active_level)) {
|
||||
$msg = $msg. "Upgrade $mtms $activate!";
|
||||
if($activate ne "concurrent") {
|
||||
$msg = "Option --actviate's value should be concurrent";
|
||||
return ("", "","", $msg, -1);
|
||||
}
|
||||
if(($pns eq $1) && ($4 <= $active_level)) {
|
||||
$msg = $msg. "Upgrade $mtms $activate!";
|
||||
# if($activate ne "concurrent") {
|
||||
# $msg = "Option --actviate's value should be disruptive";
|
||||
# return ("", "","", $msg, -1);
|
||||
# }
|
||||
} else {
|
||||
$msg = $msg . "Upgrade $mtms!";
|
||||
if($activate ne "disruptive") {
|
||||
$msg = "Option --activate's value should be disruptive";
|
||||
$msg = $msg . "Upgrade $mtms!";
|
||||
if($activate !~ /^(disruptive|concurrent)$/) {
|
||||
$msg = "Option --activate's value shouldn't be $activate, and it must be disruptive or concurrent";
|
||||
return ("", "","", $msg, -1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ sub parse_args {
|
||||
$Getopt::Long::ignorecase = 0;
|
||||
Getopt::Long::Configure( "bundling" );
|
||||
|
||||
if ( !GetOptions( \%opt, qw(V|verbose u w x z) )){
|
||||
if ( !GetOptions( \%opt, qw(V|Verbose u w x z) )){
|
||||
return( usage() );
|
||||
}
|
||||
####################################
|
||||
|
||||
@@ -40,7 +40,7 @@ sub parse_args {
|
||||
$Getopt::Long::ignorecase = 0;
|
||||
Getopt::Long::Configure( "bundling" );
|
||||
|
||||
if ( !GetOptions( \%opt, qw(V|verbose) )) {
|
||||
if ( !GetOptions( \%opt, qw(V|Verbose) )) {
|
||||
return( usage() );
|
||||
}
|
||||
####################################
|
||||
|
||||
+3
-29
@@ -8,7 +8,7 @@ use xCAT::PPCdb;
|
||||
use xCAT::Usage;
|
||||
use xCAT::NodeRange;
|
||||
use Data::Dumper;
|
||||
use xCAT::MsgUtils qw(verbose_message);
|
||||
|
||||
|
||||
##############################################
|
||||
# Globals
|
||||
@@ -504,7 +504,6 @@ sub clone {
|
||||
# Enumerate CECs
|
||||
#####################################
|
||||
my $filter = "type_model,serial_num";
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} :lssyscfg fsps.filter:'$filter'.");
|
||||
my $cecs = xCAT::PPCcli::lssyscfg( $exp, "fsps", $filter );
|
||||
my $Rc = shift(@$cecs);
|
||||
|
||||
@@ -580,7 +579,6 @@ sub clone {
|
||||
$temp[2] = $destcec;
|
||||
$temp[4] = 'lpar';
|
||||
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} :mksyscfg lpar.cfg:'$cfg'.");
|
||||
my $result = xCAT::PPCcli::mksyscfg( $exp, "lpar", \@temp, $cfg );
|
||||
$Rc = shift(@$result);
|
||||
|
||||
@@ -620,7 +618,6 @@ sub remove {
|
||||
my @lpars = ();
|
||||
my @values = ();
|
||||
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} START.");
|
||||
while (my ($mtms,$h) = each(%$hash) ) {
|
||||
while (my ($lpar,$d) = each(%$h) ) {
|
||||
my $lparid = @$d[0];
|
||||
@@ -644,7 +641,6 @@ sub remove {
|
||||
####################################
|
||||
else {
|
||||
my $filter = "name,lpar_id";
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} :lssyscfg lpar.filter:'$filter'.");
|
||||
my $result = xCAT::PPCcli::lssyscfg(
|
||||
$exp,
|
||||
"lpar",
|
||||
@@ -677,7 +673,6 @@ sub remove {
|
||||
###############################################
|
||||
# begin to retrieve the CEC's service lpar id
|
||||
###############################################
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} :lssyscfg fsp.filter:'service_lpar_id'.");
|
||||
my $service_lparid = xCAT::PPCcli::lssyscfg(
|
||||
$exp,
|
||||
"fsp",
|
||||
@@ -692,7 +687,6 @@ sub remove {
|
||||
my $cfgdata = @$service_lparid[0];
|
||||
if ( ($id == $cfgdata) && ($cfgdata !~ /none/) ) {
|
||||
$cfgdata = "service_lpar_id=none";
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} :lssyscfg fsp.filter:'$cfgdata'.");
|
||||
my $result = xCAT::PPCcli::chsyscfg( $exp, "fsp", $d, $cfgdata );
|
||||
$Rc = shift(@$result);
|
||||
if ( $Rc != SUCCESS ) {
|
||||
@@ -709,7 +703,6 @@ sub remove {
|
||||
################################
|
||||
# Send remove command
|
||||
################################
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} :rmsyscfg lpar.id:$id.");
|
||||
my $result = xCAT::PPCcli::rmsyscfg( $exp, \@d );
|
||||
my $Rc = shift(@$result);
|
||||
|
||||
@@ -717,7 +710,6 @@ sub remove {
|
||||
# Remove LPAR from database
|
||||
################################
|
||||
if ( $Rc == SUCCESS and !exists( $opt->{r} ) ) {
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} :remove lpar:$name from xCATdb.");
|
||||
my $err = xCATdB( "rmvm", $name,"", $id,"", $type,"" , $lpar );
|
||||
if ( defined( $err )) {
|
||||
push @values, [$lpar,$err,RC_ERROR];
|
||||
@@ -728,7 +720,6 @@ sub remove {
|
||||
}
|
||||
}
|
||||
}
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} END.");
|
||||
return( \@values );
|
||||
}
|
||||
|
||||
@@ -800,7 +791,6 @@ sub modify_by_attr {
|
||||
my $attrstr= $opt->{a};
|
||||
my @values;
|
||||
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} START.");
|
||||
# attrstr will be in stdin for "cat vmdef | chvm nodename"
|
||||
if (!defined($attrstr) && defined($request->{stdin})) {
|
||||
my $tempattr = $request->{stdin};
|
||||
@@ -846,7 +836,6 @@ sub modify_by_attr {
|
||||
###########################
|
||||
# Get current profile
|
||||
###########################
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} :lssyscfg node.id:'@$d[0]'.");
|
||||
my $cfg_res = xCAT::PPCcli::lssyscfg(
|
||||
$exp,
|
||||
"node",
|
||||
@@ -879,7 +868,6 @@ sub modify_by_attr {
|
||||
}
|
||||
|
||||
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} :lssyscfg prof.filter:'lpar_ids=@$d[0],profile_names=@$cfg_res[0]'.");
|
||||
my $prof = xCAT::PPCcli::lssyscfg(
|
||||
$exp,
|
||||
"prof",
|
||||
@@ -905,14 +893,12 @@ sub modify_by_attr {
|
||||
push @values, [$lpar, $err_msg, $Rc];
|
||||
next;
|
||||
}
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} :chsyscfg prof.cfg:'$cfgdata'.");
|
||||
my $result = xCAT::PPCcli::chsyscfg( $exp, "prof", $d, $cfgdata );
|
||||
$Rc = shift(@$result);
|
||||
push @values, [$lpar,@$result[0],$Rc];
|
||||
}
|
||||
}
|
||||
}
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} END.");
|
||||
return (\@values);
|
||||
}
|
||||
|
||||
@@ -1018,7 +1004,6 @@ sub modify_by_prof {
|
||||
my $profile = $opt->{p};
|
||||
my @values;
|
||||
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} START.");
|
||||
#######################################
|
||||
# -p flag, find profile specified
|
||||
#######################################
|
||||
@@ -1044,7 +1029,6 @@ sub modify_by_prof {
|
||||
###########################
|
||||
# Get LPAR profiles
|
||||
###########################
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} :lssyscfg prof.filter:'lpar_ids=@$d[0],profile_names=$profile'.");
|
||||
my $prof = xCAT::PPCcli::lssyscfg(
|
||||
$exp,
|
||||
"prof",
|
||||
@@ -1116,7 +1100,6 @@ sub modify_by_prof {
|
||||
# Send command
|
||||
###############################
|
||||
if ( defined( $profile )) {
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} :mksyscfg prof.cfg:'$cfg'.");
|
||||
my $result = xCAT::PPCcli::mksyscfg( $exp, "prof", $d, $cfg );
|
||||
my $Rc = shift(@$result);
|
||||
|
||||
@@ -1129,14 +1112,12 @@ sub modify_by_prof {
|
||||
push @values, [$lpar,@$result[0],$Rc];
|
||||
}
|
||||
else {
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} :chsyscfg prof.cfg:'$cfg'.");
|
||||
my $result = xCAT::PPCcli::chsyscfg( $exp, "prof", $d, $cfg );
|
||||
my $Rc = shift(@$result);
|
||||
push @values, [$lpar,@$result[0],$Rc];
|
||||
}
|
||||
}
|
||||
}
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} END.");
|
||||
return( \@values );
|
||||
}
|
||||
|
||||
@@ -1155,7 +1136,6 @@ sub list {
|
||||
my @lpars = ();
|
||||
my $result;
|
||||
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} START.");
|
||||
while (my ($mtms,$h) = each(%$hash) ) {
|
||||
while (my ($lpar,$d) = each(%$h) ) {
|
||||
my $lparid = @$d[0];
|
||||
@@ -1181,7 +1161,6 @@ sub list {
|
||||
####################################
|
||||
else {
|
||||
my $filter = "name,lpar_id";
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} :lssyscfg lpar.filter:'$filter'.");
|
||||
my $result = xCAT::PPCcli::lssyscfg(
|
||||
$exp,
|
||||
"lpar",
|
||||
@@ -1212,7 +1191,6 @@ sub list {
|
||||
#################################
|
||||
# Get source LPAR profile
|
||||
#################################
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} :lssyscfg prof.filter:'lpar_ids=$id'.");
|
||||
my $prof = xCAT::PPCcli::lssyscfg(
|
||||
$exp,
|
||||
"prof",
|
||||
@@ -1266,7 +1244,7 @@ sub list {
|
||||
foreach ( sort keys %$values ) {
|
||||
push @value,$values->{$_};
|
||||
}
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} END.");
|
||||
|
||||
return( \@value );
|
||||
}
|
||||
##########################################################################
|
||||
@@ -1626,7 +1604,7 @@ sub create {
|
||||
my $mtms;
|
||||
my $type;
|
||||
my $profile;
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} START.");
|
||||
|
||||
#####################################
|
||||
# Get source node information
|
||||
#####################################
|
||||
@@ -1665,7 +1643,6 @@ sub create {
|
||||
#####################################
|
||||
# Get source LPAR profile
|
||||
#####################################
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} :lssyscfg prof.filter:'lpar_ids=$lparid'.");
|
||||
my $prof = xCAT::PPCcli::lssyscfg(
|
||||
$exp,
|
||||
"prof",
|
||||
@@ -1744,7 +1721,6 @@ sub create {
|
||||
#################################
|
||||
# Create new LPAR
|
||||
#################################
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} :mksyscfg lpar.cfg:'$cfgdata'.");
|
||||
$result = xCAT::PPCcli::mksyscfg( $exp, "lpar", $d, $cfgdata );
|
||||
$Rc = shift(@$result);
|
||||
|
||||
@@ -1752,7 +1728,6 @@ sub create {
|
||||
# Add new LPAR to database
|
||||
#################################
|
||||
if ( $Rc == SUCCESS ) {
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} :add lpar:$name from xCATdb.");
|
||||
my $err = xCATdB( "mkvm", $name, $profile, $id, $d, $hwtype, $lpar);
|
||||
if ( defined( $err )) {
|
||||
push @values, [$name,$err,RC_ERROR];
|
||||
@@ -1763,7 +1738,6 @@ sub create {
|
||||
push @values, [$name,@$result[0],$Rc];
|
||||
$id++;
|
||||
}
|
||||
xCAT::MsgUtils->verbose_message($request, "$request->{command} END.");
|
||||
return( \@values );
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+16
-47
@@ -5,7 +5,7 @@ package xCAT::RSYNC;
|
||||
|
||||
# cannot use strict
|
||||
use base xCAT::DSHRemoteShell;
|
||||
use xCAT::TableUtils qw(get_site_attribute);
|
||||
|
||||
# Determine if OS is AIX or Linux
|
||||
# Configure standard locations of commands based on OS
|
||||
|
||||
@@ -35,7 +35,6 @@ if ($^O eq 'linux')
|
||||
$class - Calling module name (discarded)
|
||||
$config - Reference to copy command configuration hash table
|
||||
$exec_path - Path to rsync executable
|
||||
$localhost - 1 indicates we are running on the Management Node
|
||||
|
||||
Returns:
|
||||
A command array for the rsync command with the appropriate
|
||||
@@ -69,7 +68,7 @@ if ($^O eq 'linux')
|
||||
|
||||
sub remote_copy_command
|
||||
{
|
||||
my ($class, $config, $exec_path,$localhost) = @_;
|
||||
my ($class, $config, $exec_path) = @_;
|
||||
|
||||
$exec_path || ($exec_path = $RSYNC_CMD);
|
||||
|
||||
@@ -77,7 +76,7 @@ sub remote_copy_command
|
||||
my $usersh=0;
|
||||
if ($^O eq 'aix')
|
||||
{
|
||||
my @useSSH = xCAT::TableUtils->get_site_attribute("useSSHonAIX");
|
||||
my @useSSH = xCAT::Utils->get_site_attribute("useSSHonAIX");
|
||||
if (defined($useSSH[0])) {
|
||||
$useSSH[0] =~ tr/a-z/A-Z/; # convert to upper
|
||||
if (($useSSH[0] eq "0") || ($useSSH[0] eq "NO"))
|
||||
@@ -97,22 +96,14 @@ sub remote_copy_command
|
||||
if ($^O eq 'aix')
|
||||
{
|
||||
if (-e ("/usr/bin/rsync")) {
|
||||
if (($usersh == 0) || ($localhost == 1)) { # using ssh, or local
|
||||
if ($$config{'sudo'}){
|
||||
$sync_opt = '--rsync-path=sudo /usr/bin/rsync ';
|
||||
} else {
|
||||
if ($usersh == 0) { # using ssh
|
||||
$sync_opt = '--rsync-path /usr/bin/rsync ';
|
||||
}
|
||||
} else {
|
||||
$sync_opt = '--rsh /bin/rsh --rsync-path /usr/bin/rsync ';
|
||||
}
|
||||
} else {
|
||||
if (($usersh == 0) || ($localhost == 1)) { # using ssh, or local
|
||||
if ($$config{'sudo'}){
|
||||
$sync_opt = '--rsync-path=sudo /usr/local/bin/rsync ';
|
||||
} else {
|
||||
$sync_opt = '--rsync-path=/usr/local/bin/rsync ';
|
||||
}
|
||||
if ($usersh == 0) { # using ssh
|
||||
$sync_opt = '--rsync-path /usr/local/bin/rsync ';
|
||||
} else {
|
||||
$sync_opt = '--rsh /bin/rsh --rsync-path /usr/local/bin/rsync ';
|
||||
}
|
||||
@@ -120,16 +111,11 @@ sub remote_copy_command
|
||||
}
|
||||
else #linux
|
||||
{
|
||||
if ($$config{'sudo'}) {
|
||||
$sync_opt = '--rsync-path=\'sudo /usr/bin/rsync\' ';
|
||||
} else {
|
||||
$sync_opt = '--rsync-path /usr/bin/rsync ';
|
||||
}
|
||||
}
|
||||
# if only syncing the service node or
|
||||
# (no postscripts and no append lines) then do not
|
||||
# if only syncing the service node or no postscripts then do not
|
||||
# get update file notification
|
||||
if (($::SYNCSN == 1) || ((!(defined @::postscripts)) && (!(defined @::appendlines)) && (!(defined @::mergelines)))) {
|
||||
if (($::SYNCSN == 1) || (!(defined @::postscripts))) {
|
||||
$sync_opt .= '-Lprogtz ';
|
||||
} else {
|
||||
$sync_opt .= '-Liprogtz --out-format=%f%L '; # add notify of update
|
||||
@@ -154,17 +140,12 @@ sub remote_copy_command
|
||||
"$$config{'dest-user'}@" . "$$config{'dest-host'}";
|
||||
}
|
||||
print RSCYCCMDFILE "#!/bin/sh\n";
|
||||
if ($localhost == 1) { # running to the MN from the MN
|
||||
print RSCYCCMDFILE
|
||||
"/bin/mkdir -p $dest_dir_list\n";
|
||||
} else { # running to another node
|
||||
if ($usersh == 0) { # using ssh
|
||||
print RSCYCCMDFILE
|
||||
"/usr/bin/ssh $dest_user_host '/bin/mkdir -p $dest_dir_list'\n";
|
||||
} else {
|
||||
print RSCYCCMDFILE
|
||||
"/usr/bin/rsh $dest_user_host '/bin/mkdir -p $dest_dir_list'\n";
|
||||
}
|
||||
if ($usersh == 0) { # using ssh
|
||||
print RSCYCCMDFILE
|
||||
"/usr/bin/ssh $dest_user_host '/bin/mkdir -p $dest_dir_list'\n";
|
||||
} else {
|
||||
print RSCYCCMDFILE
|
||||
"/usr/bin/rsh $dest_user_host '/bin/mkdir -p $dest_dir_list'\n";
|
||||
}
|
||||
foreach my $dest_dir (keys %{$$config{'destDir_srcFile'}})
|
||||
{
|
||||
@@ -174,28 +155,16 @@ sub remote_copy_command
|
||||
my $src_file_list = join ' ', @src_file;
|
||||
if ($src_file_list)
|
||||
{
|
||||
if ($localhost == 1) { # running local ( on MN)
|
||||
print RSCYCCMDFILE
|
||||
"$exec_path $sync_opt $src_file_list $dest_dir\n";
|
||||
} else { # running to another node
|
||||
print RSCYCCMDFILE
|
||||
"$exec_path $sync_opt $src_file_list $dest_user_host:$dest_dir\n";
|
||||
}
|
||||
"$exec_path $sync_opt $src_file_list $dest_user_host:$dest_dir\n";
|
||||
}
|
||||
my %diff_dest_hash =
|
||||
%{$$config{'destDir_srcFile'}{$dest_dir}{'diff_dest_name'}};
|
||||
foreach my $src_file_diff_dest (keys %diff_dest_hash)
|
||||
{
|
||||
|
||||
my $diff_basename = $diff_dest_hash{$src_file_diff_dest};
|
||||
# if localhost do not put in hostname:
|
||||
if ($localhost == 1) { # running to the MN from the MN (local)
|
||||
print RSCYCCMDFILE
|
||||
"$exec_path $sync_opt $src_file_diff_dest $dest_dir/$diff_basename\n";
|
||||
} else { # running remote
|
||||
print RSCYCCMDFILE
|
||||
print RSCYCCMDFILE
|
||||
"$exec_path $sync_opt $src_file_diff_dest $dest_user_host:$dest_dir/$diff_basename\n";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ sub remoteshellexp
|
||||
if (!($flag))
|
||||
{
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] =
|
||||
$rsp->{data}->[0] =
|
||||
"No flag provide to remoteshellexp.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK, 2);
|
||||
return 2;
|
||||
@@ -84,7 +84,7 @@ sub remoteshellexp
|
||||
|
||||
if (($flag ne "k") && ($flag ne "t") && ($flag ne "s")) {
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] =
|
||||
$rsp->{data}->[0] =
|
||||
"Invalid flag $flag provided.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK, 1);
|
||||
return 2;
|
||||
@@ -99,14 +99,14 @@ sub remoteshellexp
|
||||
if ($flag eq "s"){
|
||||
if (!$to_user_password) {
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] =
|
||||
$rsp->{data}->[0] =
|
||||
"The DSH_REMOTE_PASSWORD environment variable has not been set to the user id password on the node which will have their ssh keys updated (ususally root).";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK, 1);
|
||||
return 2;
|
||||
}
|
||||
if (!$nodes) {
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] =
|
||||
$rsp->{data}->[0] =
|
||||
"No nodes were input to update the user's ssh keys.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK, 1);
|
||||
return 2;
|
||||
@@ -162,7 +162,7 @@ sub remoteshellexp
|
||||
# Check to see if empty
|
||||
if (-z $key) {
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] =
|
||||
$rsp->{data}->[0] =
|
||||
"The $key file is empty. Remove it and rerun the command.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK, 1);
|
||||
return 1;
|
||||
@@ -170,7 +170,7 @@ sub remoteshellexp
|
||||
}
|
||||
if (-z $key2) {
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] =
|
||||
$rsp->{data}->[0] =
|
||||
"The $key2 file is empty. Remove it and rerun the command.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK, 1);
|
||||
return 1;
|
||||
@@ -187,7 +187,7 @@ sub remoteshellexp
|
||||
{
|
||||
if (!($nodes)) {
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] =
|
||||
$rsp->{data}->[0] =
|
||||
"There are no nodes defined to update the ssh keys.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK, 1);
|
||||
return 1;
|
||||
@@ -267,7 +267,7 @@ sub gensshkeys
|
||||
unless ($keygen->spawn($spawncmd))
|
||||
{
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] =
|
||||
$rsp->{data}->[0] =
|
||||
"Unable to run $spawncmd.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK, 1);
|
||||
return 1;
|
||||
@@ -324,8 +324,8 @@ sub gensshkeys
|
||||
return 0;
|
||||
} else {
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] = $msg;
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
|
||||
$rsp->{data}->[0] = $msg;
|
||||
xCAT::MsgUtils->message("I", $rsp, $::CALLBACK);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -394,7 +394,7 @@ sub testkeys
|
||||
unless ($testkeys->spawn($spawncmd))
|
||||
{
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] =
|
||||
$rsp->{data}->[0] =
|
||||
"Unable to run $spawncmd.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK, 1);
|
||||
return 1;
|
||||
@@ -446,8 +446,8 @@ sub testkeys
|
||||
return 0;
|
||||
} else {
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] = $msg;
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
|
||||
$rsp->{data}->[0] = $msg;
|
||||
xCAT::MsgUtils->message("I", $rsp, $::CALLBACK);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -522,7 +522,7 @@ sub sendnodeskeys
|
||||
unless ($sendkeys->spawn($spawnmkdir))
|
||||
{
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] =
|
||||
$rsp->{data}->[0] =
|
||||
"Unable to run $spawnmkdir on $node";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK, 1);
|
||||
next;
|
||||
@@ -571,8 +571,8 @@ sub sendnodeskeys
|
||||
$rc=0;
|
||||
} else {
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] = "mkdir:$node has error,$msg";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
|
||||
$rsp->{data}->[0] = "mkdir:$node has error,$msg";
|
||||
xCAT::MsgUtils->message("I", $rsp, $::CALLBACK);
|
||||
$rc=1;
|
||||
}
|
||||
}
|
||||
@@ -612,7 +612,7 @@ sub sendnodeskeys
|
||||
unless ($sendkeys->spawn($spawncopyfiles))
|
||||
{
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] =
|
||||
$rsp->{data}->[0] =
|
||||
"Unable to run $spawncopyfiles on $node.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK, 1);
|
||||
next;
|
||||
@@ -658,8 +658,8 @@ sub sendnodeskeys
|
||||
$rc=0;
|
||||
} else {
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] = "copykeys:$node has error,$msg";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
|
||||
$rsp->{data}->[0] = "copykeys:$node has error,$msg";
|
||||
xCAT::MsgUtils->message("I", $rsp, $::CALLBACK);
|
||||
$rc=1;
|
||||
}
|
||||
}
|
||||
@@ -693,7 +693,7 @@ sub sendnodeskeys
|
||||
unless ($sendkeys->spawn($spawnruncopy))
|
||||
{
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] =
|
||||
$rsp->{data}->[0] =
|
||||
"Unable to run $spawnruncopy.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK, 1);
|
||||
next; # go to next node
|
||||
@@ -743,8 +743,8 @@ sub sendnodeskeys
|
||||
$rc=0;
|
||||
} else {
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] = "copy.sh:$node has error,$msg";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
|
||||
$rsp->{data}->[0] = "copy.sh:$node has error,$msg";
|
||||
xCAT::MsgUtils->message("I", $rsp, $::CALLBACK);
|
||||
$rc=1;
|
||||
}
|
||||
}
|
||||
@@ -829,7 +829,7 @@ sub senddeviceskeys
|
||||
unless ($sendkeys->spawn($spawnaddkey))
|
||||
{
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] =
|
||||
$rsp->{data}->[0] =
|
||||
"Unable to run $spawnaddkey.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK, 1);
|
||||
next; # go to next node
|
||||
@@ -877,8 +877,8 @@ sub senddeviceskeys
|
||||
$rc=0;
|
||||
} else {
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] = "$node has error,$msg";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
|
||||
$rsp->{data}->[0] = "$node has error,$msg";
|
||||
xCAT::MsgUtils->message("I", $rsp, $::CALLBACK);
|
||||
$rc=1;
|
||||
next; # go to next node
|
||||
}
|
||||
|
||||
+3
-30
@@ -60,10 +60,9 @@ sub usage
|
||||
" -p <template path> [-o output file ] [-t <template count>]\n";
|
||||
my $usagemsg4 = " [-r remove templates] [-s <seednode>]\n";
|
||||
my $usagemsg5 = " [-e exactmatch] [-i ignore] [-V verbose]\n";
|
||||
my $usagemsg5A = " [-l userid] [--devicetype type_of_device]\n";
|
||||
my $usagemsg6 = " {-c <command> | -f <command file>}";
|
||||
my $usagemsg .= $usagemsg1 .= $usagemsg1a .= $usagemsg3 .= $usagemsg4 .=
|
||||
$usagemsg5 .= $usagemsg5A .= $usagemsg6;
|
||||
$usagemsg5 .= $usagemsg6;
|
||||
### end usage mesage
|
||||
|
||||
my $rsp = {};
|
||||
@@ -111,8 +110,6 @@ sub parse_and_run_sinv
|
||||
's|seed=s' => \$options{'seed_node'},
|
||||
'e|exactmatch' => \$options{'exactmatch'},
|
||||
'i|ignorefirst' => \$options{'ignorefirst'},
|
||||
'l|user=s' => \$options{'user'},
|
||||
'devicetype|devicetype=s' => \$options{'devicetype'},
|
||||
'c|cmd=s' => \$options{'sinv_cmd'},
|
||||
'f|file=s' => \$options{'sinv_cmd_file'},
|
||||
'v|version' => \$options{'version'},
|
||||
@@ -201,36 +198,14 @@ sub parse_and_run_sinv
|
||||
# strip off the program and the noderange
|
||||
#
|
||||
my @nodelist = ();
|
||||
my @cmdparts = ();
|
||||
if ($options{'devicetype'}) {
|
||||
# must split different because devices have commands with spaces
|
||||
@cmdparts = split(' ', $cmd,3);
|
||||
} else {
|
||||
@cmdparts = split(' ', $cmd);
|
||||
}
|
||||
my @cmdparts = split(' ', $cmd);
|
||||
my $cmdtype = shift @cmdparts;
|
||||
my $noderange = shift @cmdparts;
|
||||
my @cmd = ();
|
||||
if ($noderange =~ /^-/) # if imageupdate not node
|
||||
if ($noderange =~ /^-/)
|
||||
{ # no noderange
|
||||
push @cmd, $noderange; # put flag back on command
|
||||
}
|
||||
# root is sending the command
|
||||
my @envs;
|
||||
# if -l user id supplied
|
||||
if ($options{'user'}) {
|
||||
push @cmd,"-l";
|
||||
push @cmd,$options{'user'};
|
||||
push @envs,"DSH_TO_USERID=$options{'user'}";
|
||||
}
|
||||
# if device type supplied
|
||||
if ($options{'devicetype'}) {
|
||||
push @cmd,"--devicetype";
|
||||
my $switchtype = $options{'devicetype'};
|
||||
$switchtype =~ s/::/\//g;
|
||||
push @cmd,$switchtype;
|
||||
}
|
||||
|
||||
foreach my $part (@cmdparts)
|
||||
{
|
||||
|
||||
@@ -496,7 +471,6 @@ sub parse_and_run_sinv
|
||||
{
|
||||
command => [$cmdtype],
|
||||
node => \@seed,
|
||||
env => [@envs],
|
||||
arg => [@cmd]
|
||||
},
|
||||
\&$cmdoutput
|
||||
@@ -526,7 +500,6 @@ sub parse_and_run_sinv
|
||||
{
|
||||
command => [$cmdtype],
|
||||
node => \@nodelist,
|
||||
env => [@envs],
|
||||
arg => [@cmd]
|
||||
},
|
||||
\&$cmdoutput
|
||||
|
||||
+70
-64
@@ -81,6 +81,7 @@ sub dodiscover {
|
||||
}
|
||||
}
|
||||
}
|
||||
# for print information
|
||||
my @printip;
|
||||
foreach my $iface (keys %{$interfaces}) {
|
||||
foreach my $sip (@{$interfaces->{$iface}->{ipv4addrs}}) {
|
||||
@@ -90,7 +91,7 @@ sub dodiscover {
|
||||
}
|
||||
}
|
||||
my $printinfo = join(",", @printip);
|
||||
send_message($args{reqcallback}, 0, "Sending SLP request on interfaces: $printinfo ...") if ($args{reqcallback} and !$args{nomsg} );
|
||||
send_message($args{reqcallback}, 0, "Sending SLP request on interfaces: $printinfo ...") if ($args{reqcallback});
|
||||
foreach my $srvtype (@srvtypes) {
|
||||
send_service_request_single(%args,ifacemap=>$interfaces,SrvType=>$srvtype);
|
||||
}
|
||||
@@ -98,12 +99,12 @@ sub dodiscover {
|
||||
unless ($args{NoWait}) { #in nowait, caller owns the responsibility..
|
||||
#by default, report all respondants within 3 seconds:
|
||||
my $waitforsocket = IO::Select->new();
|
||||
$waitforsocket->add($args{'socket'});
|
||||
$waitforsocket->add($args{'socket'});
|
||||
my $retrytime = ($args{Retry}>0)?$args{Retry}+1:3;
|
||||
my $retryinterval = ($args{Retry}>0)?$args{Retry}:REQ_INTERVAL;
|
||||
my $waittime = ($args{Time}>0)?$args{Time}:20;
|
||||
my @peerarray;
|
||||
my @pkgarray;
|
||||
my @pkgarray;
|
||||
|
||||
my $startinterval = time();
|
||||
my $interval;
|
||||
@@ -116,87 +117,87 @@ sub dodiscover {
|
||||
# receive untill there is none
|
||||
########################################
|
||||
while ($waitforsocket->can_read(0)) {
|
||||
my $peer = $args{'socket'}->recv($slppacket,3000,0);
|
||||
my $peer = $args{'socket'}->recv($slppacket,1400,0);
|
||||
push @peerarray, $peer;
|
||||
push @pkgarray, $slppacket;
|
||||
}
|
||||
#######################################
|
||||
# process the packets
|
||||
#######################################
|
||||
for(my $j = 0; $j< scalar(@peerarray); $j++) {
|
||||
my $pkg = $peerarray[$j];
|
||||
my $slpkg = $pkgarray[$j];
|
||||
if ($ip6support) {
|
||||
( $port,$flow,$ip6n,$scope) = Socket6::unpack_sockaddr_in6_all($pkg);
|
||||
$peername = Socket6::inet_ntop(Socket6::AF_INET6(),$ip6n);
|
||||
} else {
|
||||
($port,$ip4n) = sockaddr_in($pkg);
|
||||
$peername = inet_ntoa($ip4n);
|
||||
}
|
||||
if ($rethash{$peername}) {
|
||||
next; #got a dupe, discard
|
||||
}
|
||||
my $result = process_slp_packet(packet=>$slpkg,sockaddr=>$pkg,'socket'=>$args{'socket'});
|
||||
if ($result) {
|
||||
if ($peername =~ /\./) { #ipv4
|
||||
$peername =~ s/::ffff://;
|
||||
}
|
||||
$result->{peername} = $peername;
|
||||
if ($gprlist) {
|
||||
$gprlist .= ','.$peername if(length($gprlist) < 1250);
|
||||
} else {
|
||||
$gprlist = $peername;
|
||||
}
|
||||
$result->{scopeid} = $scope;
|
||||
$result->{sockaddr} = $pkg;
|
||||
my $hashkey;
|
||||
if ($peername =~ /fe80/) {
|
||||
$peername .= '%'.$scope;
|
||||
}
|
||||
$rspcount++;
|
||||
$rspcount1++;
|
||||
$rethash{$peername} = $result;
|
||||
|
||||
if ($args{Callback}) {
|
||||
$args{Callback}->($result);
|
||||
}
|
||||
}
|
||||
}
|
||||
for(my $j = 0; $j< scalar(@peerarray); $j++) {
|
||||
my $pkg = $peerarray[$j];
|
||||
my $slpkg = $pkgarray[$j];
|
||||
if ($ip6support) {
|
||||
( $port,$flow,$ip6n,$scope) = Socket6::unpack_sockaddr_in6_all($pkg);
|
||||
$peername = Socket6::inet_ntop(Socket6::AF_INET6(),$ip6n);
|
||||
} else {
|
||||
($port,$ip4n) = sockaddr_in($pkg);
|
||||
$peername = inet_ntoa($ip4n);
|
||||
}
|
||||
if ($rethash{$peername}) {
|
||||
next; #got a dupe, discard
|
||||
}
|
||||
my $result = process_slp_packet(packet=>$slpkg,sockaddr=>$pkg,'socket'=>$args{'socket'});
|
||||
if ($result) {
|
||||
if ($peername =~ /\./) { #ipv4
|
||||
$peername =~ s/::ffff://;
|
||||
}
|
||||
$result->{peername} = $peername;
|
||||
if ($gprlist) {
|
||||
$gprlist .= ','.$peername if(length($gprlist) < 1250);
|
||||
} else {
|
||||
$gprlist = $peername;
|
||||
}
|
||||
$result->{scopeid} = $scope;
|
||||
$result->{sockaddr} = $pkg;
|
||||
my $hashkey;
|
||||
if ($peername =~ /fe80/) {
|
||||
$peername .= '%'.$scope;
|
||||
}
|
||||
$rspcount++;
|
||||
$rspcount1++;
|
||||
$rethash{$peername} = $result;
|
||||
if ($args{Callback}) {
|
||||
$args{Callback}->($result);
|
||||
}
|
||||
}
|
||||
}
|
||||
#############################
|
||||
# check if need to return
|
||||
#############################
|
||||
@peerarray = ();
|
||||
@pkgarray = ();
|
||||
$interval = time() - $startinterval;
|
||||
if ($args{Time} and $args{Count}) {
|
||||
if ($rspcount >= $args{Count} or $interval >= $args{Time}) {
|
||||
send_message($args{reqcallback}, 0, "Received $rspcount1 responses.") if ($args{reqcallback} and !$args{nomsg});
|
||||
last;
|
||||
@peerarray = ();
|
||||
@pkgarray = ();
|
||||
$interval = time() - $startinterval;
|
||||
if ($args{Time} and $args{Count}) {
|
||||
if ($rspcount >= $args{Count} or $interval >= $args{Time}) {
|
||||
send_message($args{reqcallback}, 0, "Received $rspcount1 responses.") if ($args{reqcallback});
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($sendcount > $retrytime and $rspcount1 == 0) {
|
||||
send_message($args{reqcallback}, 0, "Received $rspcount1 responses.") if ($args{reqcallback} and !$args{nomsg});
|
||||
send_message($args{reqcallback}, 0, "Received $rspcount1 responses.") if ($args{reqcallback});
|
||||
last;
|
||||
}
|
||||
#########################
|
||||
# send request again
|
||||
#########################
|
||||
if ( $interval > $retryinterval){#* (2**$sendcount))) { #double time
|
||||
$sendcount++;
|
||||
$startinterval = time();
|
||||
send_message($args{reqcallback}, 0, "Received $rspcount1 responses.") if ($args{reqcallback} and !$args{nomsg});
|
||||
send_message($args{reqcallback}, 0, "Sending SLP request on interfaces: $printinfo ...") if ($args{reqcallback} and !$args{nomsg});
|
||||
foreach my $srvtype (@srvtypes) {
|
||||
send_service_request_single(%args,ifacemap=>$interfaces,SrvType=>$srvtype);
|
||||
}
|
||||
if ( $interval > $retryinterval){#* (2**$sendcount))) { #double time
|
||||
$sendcount++;
|
||||
$startinterval = time();
|
||||
send_message($args{reqcallback}, 0, "Received $rspcount1 responses.") if ($args{reqcallback});
|
||||
send_message($args{reqcallback}, 0, "Sending SLP request on interfaces: $printinfo ...") if ($args{reqcallback});
|
||||
foreach my $srvtype (@srvtypes) {
|
||||
send_service_request_single(%args,ifacemap=>$interfaces,SrvType=>$srvtype);
|
||||
}
|
||||
$rspcount1 = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} #end nowait
|
||||
} #end nowait
|
||||
|
||||
foreach my $entry (keys %rethash) {
|
||||
handle_new_slp_entity($rethash{$entry})
|
||||
}
|
||||
}
|
||||
if (xCAT::Utils->isAIX()) {
|
||||
foreach my $iface (keys %{$interfaces}) {
|
||||
foreach my $sip (@{$interfaces->{$iface}->{ipv4addrs}}) {
|
||||
@@ -645,11 +646,16 @@ sub get_ipv6_neighbors {
|
||||
}
|
||||
}
|
||||
|
||||
##########################################################################
|
||||
# Invokes the callback with the specified message
|
||||
##########################################################################
|
||||
sub send_message {
|
||||
|
||||
my $callback = shift;
|
||||
my $ecode = shift;
|
||||
my $msg = shift;
|
||||
my %output;
|
||||
|
||||
$output{errorcode} = $ecode;
|
||||
$output{data} = $msg;
|
||||
$callback->( \%output );
|
||||
|
||||
Executable → Regular
+93
-853
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,6 @@
|
||||
package xCAT::Scope;
|
||||
use xCAT::Utils;
|
||||
use xCAT::Table;
|
||||
use xCAT::ServiceNodeUtils qw(getSNList);
|
||||
sub get_broadcast_scope {
|
||||
my $req = shift;
|
||||
if ($req =~ /xCAT::Scope/) {
|
||||
@@ -11,8 +10,8 @@ sub get_broadcast_scope {
|
||||
if ($req->{_xcatpreprocessed}->[0] == 1) { return [$req]; }
|
||||
#Exit if the packet has been preprocessed in its history
|
||||
my @requests = ({%$req}); #Start with a straight copy to reflect local instance
|
||||
foreach (xCAT::ServiceNodeUtils->getSNList()) {
|
||||
if (xCAT::NetworkUtils->thishostisnot($_)) {
|
||||
foreach (xCAT::Utils->getSNList()) {
|
||||
if (xCAT::Utils->thishostisnot($_)) {
|
||||
my $reqcopy = {%$req};
|
||||
$reqcopy->{'_xcatdest'} = $_;
|
||||
$reqcopy->{_xcatpreprocessed}->[0] = 1;
|
||||
@@ -25,7 +24,7 @@ sub get_broadcast_scope {
|
||||
#$sitetab->close;
|
||||
#if ($ent and $ent->{value}) {
|
||||
# foreach (split /,/,$ent->{value}) {
|
||||
# if (xCAT::NetworkUtils->thishostisnot($_)) {
|
||||
# if (xCAT::Utils->thishostisnot($_)) {
|
||||
# my $reqcopy = {%$req};
|
||||
# $reqcopy->{'_xcatdest'} = $_;
|
||||
# push @requests,$reqcopy;
|
||||
|
||||
@@ -1,850 +0,0 @@
|
||||
#!/usr/bin/env perl
|
||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
package xCAT::ServiceNodeUtils;
|
||||
|
||||
BEGIN
|
||||
{
|
||||
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
|
||||
}
|
||||
|
||||
# if AIX - make sure we include perl 5.8.2 in INC path.
|
||||
# Needed to find perl dependencies shipped in deps tarball.
|
||||
if ($^O =~ /^aix/i) {
|
||||
use lib "/usr/opt/perl5/lib/5.8.2/aix-thread-multi";
|
||||
use lib "/usr/opt/perl5/lib/5.8.2";
|
||||
use lib "/usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi";
|
||||
use lib "/usr/opt/perl5/lib/site_perl/5.8.2";
|
||||
}
|
||||
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
use strict;
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 readSNInfo
|
||||
|
||||
Read resource, NFS server, Master node, OS an ARCH from the database
|
||||
for the service node
|
||||
|
||||
Input: service nodename
|
||||
Output: Masternode, OS and ARCH
|
||||
Example:
|
||||
my $retdata = xCAT::ServiceNodeUtils->readSNInfo;
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
sub readSNInfo
|
||||
{
|
||||
my ($class, $nodename) = @_;
|
||||
my $rc = 0;
|
||||
my $et;
|
||||
my $masternode;
|
||||
my $os;
|
||||
my $arch;
|
||||
$rc = xCAT::Utils->exportDBConfig();
|
||||
if ($rc == 0)
|
||||
{
|
||||
|
||||
if ($nodename)
|
||||
{
|
||||
$masternode = xCAT::TableUtils->GetMasterNodeName($nodename);
|
||||
if (!($masternode))
|
||||
{
|
||||
xCAT::MsgUtils->message('S',
|
||||
"Could not get Master for node $nodename\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
$et = xCAT::TableUtils->GetNodeOSARCH($nodename);
|
||||
if ($et == 1)
|
||||
{
|
||||
xCAT::MsgUtils->message('S',
|
||||
"Could not get OS/ARCH for node $nodename\n");
|
||||
return 1;
|
||||
}
|
||||
if (!($et->{'os'} || $et->{'arch'}))
|
||||
{
|
||||
xCAT::MsgUtils->message('S',
|
||||
"Could not get OS/ARCH for node $nodename\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
$et->{'master'} = $masternode;
|
||||
return $et;
|
||||
}
|
||||
return $rc;
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 isServiceReq
|
||||
|
||||
|
||||
Checks the service node table in the database to see
|
||||
if input Service should be setup on the
|
||||
input service node or Management Node (used by AAsn.pm)
|
||||
|
||||
Input:servicenodename,ipaddres(s) and hostnames of service node
|
||||
Output:
|
||||
hash of services to setup for this service node
|
||||
Globals:
|
||||
$::RUNCMD_RC = 0; good
|
||||
$::RUNCMD_RC = 1; error
|
||||
Error:
|
||||
none
|
||||
Example:
|
||||
$servicestosetup=xCAT::ServiceNodeUtils->isServiceReq($servicenodename, @serviceip) { blah; }
|
||||
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
sub isServiceReq
|
||||
{
|
||||
require xCAT::Table;
|
||||
my ($class, $servicenodename, $serviceip) = @_;
|
||||
|
||||
# list of all services from service node table
|
||||
# note this must be updated if more services added
|
||||
my @services = (
|
||||
"nameserver", "dhcpserver", "tftpserver", "nfsserver",
|
||||
"conserver", "monserver", "ldapserver", "ntpserver",
|
||||
"ftpserver", "ipforward"
|
||||
);
|
||||
|
||||
my @ips = @$serviceip; # list of service node ip addresses and names
|
||||
my $rc = 0;
|
||||
|
||||
$rc = xCAT::Utils->exportDBConfig(); # export DB env
|
||||
if ($rc != 0)
|
||||
{
|
||||
xCAT::MsgUtils->message('S', "Unable export DB environment.\n");
|
||||
$::RUNCMD_RC = 1;
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
# get handle to servicenode table
|
||||
my $servicenodetab = xCAT::Table->new('servicenode');
|
||||
unless ($servicenodetab)
|
||||
{
|
||||
xCAT::MsgUtils->message('S', "Unable to open servicenode table.\n");
|
||||
$::RUNCMD_RC = 1;
|
||||
return; # do not setup anything
|
||||
}
|
||||
|
||||
# Are we on the MN
|
||||
my $mname;
|
||||
if (xCAT::Utils->isMN()) {
|
||||
my @nodeinfo = xCAT::NetworkUtils->determinehostname;
|
||||
$mname = pop @nodeinfo; # get hostname
|
||||
}
|
||||
|
||||
my $servicehash;
|
||||
# read all the nodes from the table, for each service
|
||||
foreach my $service (@services)
|
||||
{
|
||||
my @snodelist = $servicenodetab->getAllNodeAttribs([$service]);
|
||||
|
||||
foreach $serviceip (@ips) # check the table for this servicenode
|
||||
{
|
||||
foreach my $node (@snodelist)
|
||||
|
||||
{
|
||||
if ($serviceip eq $node->{'node'})
|
||||
{ # match table entry
|
||||
if ($node->{$service})
|
||||
{ # returns service, only if set
|
||||
my $value = $node->{$service};
|
||||
$value =~ tr/a-z/A-Z/; # convert to upper
|
||||
# value 1 or yes then we setup the service
|
||||
if (($value eq "1") || ($value eq "YES"))
|
||||
{
|
||||
$servicehash->{$service} = "1";
|
||||
} else {
|
||||
$servicehash->{$service} = "0";
|
||||
}
|
||||
}
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
# if the ftpserver attribute is not defined in the service node table
|
||||
# and we are on
|
||||
# the Linux management node, we need to look at site.vsftp
|
||||
# if the tftpserver attribute is not defined, then we default it 1
|
||||
if (($mname) && (xCAT::Utils->isLinux())) {
|
||||
if (!exists($servicehash->{'ftpserver'})) {
|
||||
my @tmp = xCAT::TableUtils->get_site_attribute("vsftp");
|
||||
if ($tmp[0] && ($tmp[0] !~ /0|NO|No|no|N|n/ )) {
|
||||
$servicehash->{'ftpserver'} = 1;
|
||||
}
|
||||
}
|
||||
if (!exists($servicehash->{'tftpserver'})) {
|
||||
$servicehash->{'tftpserver'} = 1;
|
||||
}
|
||||
}
|
||||
$servicenodetab->close;
|
||||
|
||||
$::RUNCMD_RC = 0;
|
||||
return $servicehash;
|
||||
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 getAllSN
|
||||
|
||||
Returns an array of all service nodes from service node table
|
||||
|
||||
Arguments:
|
||||
ALL" - will also return the management node in the array, if
|
||||
if has been defined in the servicenode table
|
||||
Returns:
|
||||
array of Service Nodes or empty array, if none
|
||||
Globals:
|
||||
none
|
||||
Error:
|
||||
1 - error
|
||||
Example:
|
||||
@SN=xCAT::ServiceNodeUtils->getAllSN
|
||||
@allSN=xCAT::ServiceNodeUtils->getAllSN("ALL")
|
||||
Comments:
|
||||
none
|
||||
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
sub getAllSN
|
||||
{
|
||||
|
||||
my ($class, $options) = @_;
|
||||
require xCAT::Table;
|
||||
# reads all nodes from the service node table
|
||||
my @servicenodes;
|
||||
my $servicenodetab = xCAT::Table->new('servicenode');
|
||||
unless ($servicenodetab) # no servicenode table
|
||||
{
|
||||
xCAT::MsgUtils->message('I', "Unable to open servicenode table.\n");
|
||||
$servicenodetab->close;
|
||||
return @servicenodes;
|
||||
|
||||
}
|
||||
my @nodes = $servicenodetab->getAllNodeAttribs(['tftpserver']);
|
||||
foreach my $nodes (@nodes)
|
||||
{
|
||||
push @servicenodes, $nodes->{node};
|
||||
}
|
||||
# if did not input "ALL" and there is a MN, remove it
|
||||
my @newservicenodes;
|
||||
if ((!defined($options)) || ($options ne "ALL")) {
|
||||
my @mname = xCAT::Utils->noderangecontainsMn(@servicenodes);
|
||||
if (@mname) { # if there is a MN
|
||||
foreach my $node (@servicenodes) {
|
||||
# check to see if node in MN list
|
||||
if (!(grep(/^$node$/, @mname))) { # if node not in the MN array
|
||||
push @newservicenodes, $node;
|
||||
}
|
||||
}
|
||||
$servicenodetab->close;
|
||||
return @newservicenodes; # return without the MN in the array
|
||||
}
|
||||
}
|
||||
$servicenodetab->close;
|
||||
return @servicenodes;
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 getSNandNodes
|
||||
|
||||
Returns an hash-array of all service nodes and the nodes they service
|
||||
|
||||
Arguments:
|
||||
none
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 getSNandNodes
|
||||
|
||||
Returns an hash-array of all service nodes and the nodes they service
|
||||
|
||||
Arguments:
|
||||
none
|
||||
Returns:
|
||||
Service Nodes and the nodes they service or empty , if none
|
||||
Globals:
|
||||
none
|
||||
Error:
|
||||
1 - error
|
||||
Example:
|
||||
$sn=xCAT::ServiceNodeUtils->getSNandNodes()
|
||||
Comments:
|
||||
none
|
||||
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
sub getSNandNodes
|
||||
{
|
||||
|
||||
require xCAT::Table;
|
||||
# read all the nodes from the nodelist table
|
||||
# call get_ServiceNode to find which Service Node
|
||||
# the node belongs to.
|
||||
my %sn;
|
||||
my @nodes;
|
||||
my $nodelisttab = xCAT::Table->new('nodelist');
|
||||
my $recs = $nodelisttab->getAllEntries();
|
||||
foreach (@$recs)
|
||||
{
|
||||
push @nodes, $_->{node};
|
||||
}
|
||||
$nodelisttab->close;
|
||||
my $sn = xCAT::ServiceNodeUtils->get_ServiceNode(\@nodes, "xcat", "MN");
|
||||
return $sn;
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 getSNList
|
||||
|
||||
Reads the servicenode table. Will return all the enabled Service Nodes
|
||||
that will setup the input Service ( e.g tftpserver,nameserver,etc)
|
||||
If service is blank, then will return the list of all enabled Service
|
||||
Nodes.
|
||||
|
||||
Arguments:
|
||||
Servicename ( xcat,tftpserver,dhcpserver,conserver,etc)
|
||||
If no servicename, returns all Servicenodes
|
||||
"ALL" argument means you also want the MN returned. It can be in the
|
||||
servicenode list. If no "ALL", take out the MN if it is there.
|
||||
Returns:
|
||||
Array of service node names
|
||||
Globals:
|
||||
none
|
||||
Error:
|
||||
1 - error
|
||||
Example:
|
||||
$sn= xCAT::ServiceNodeUtils->getSNList($servicename) { blah; }
|
||||
$sn= xCAT::ServiceNodeUtils->getSNList($servicename,"ALL") { blah; }
|
||||
$sn= xCAT::ServiceNodeUtils->getSNList() { blah; }
|
||||
$sn= xCAT::ServiceNodeUtils->getSNList("","ALL") { blah; }
|
||||
Comments:
|
||||
none
|
||||
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
sub getSNList
|
||||
{
|
||||
require xCAT::Table;
|
||||
my ($class, $service,$options) = @_;
|
||||
|
||||
# reads all nodes from the service node table
|
||||
my @servicenodes;
|
||||
my $servicenodetab = xCAT::Table->new('servicenode', -create => 1);
|
||||
unless ($servicenodetab) # no servicenode table
|
||||
{
|
||||
xCAT::MsgUtils->message('I', "Unable to open servicenode table.\n");
|
||||
return ();
|
||||
}
|
||||
my @nodes = $servicenodetab->getAllNodeAttribs([$service]);
|
||||
$servicenodetab->close;
|
||||
foreach my $node (@nodes)
|
||||
{
|
||||
if ($service eq "") # want all the service nodes
|
||||
{
|
||||
push @servicenodes, $node->{node};
|
||||
}
|
||||
else
|
||||
{ # looking for a particular service
|
||||
if ($node->{$service})
|
||||
{ # if null then do not add node
|
||||
my $value = $node->{$service};
|
||||
$value =~ tr/a-z/A-Z/; # convert to upper
|
||||
# value 1 or yes or blank then we setup the service
|
||||
if (($value == 1) || ($value eq "YES"))
|
||||
{
|
||||
push @servicenodes, $node->{node};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
# if did not input "ALL" and there is a MN, remove it
|
||||
my @newservicenodes;
|
||||
if ((!defined($options)) || ($options ne "ALL")) {
|
||||
my $mname = xCAT::Utils->noderangecontainsMn(@servicenodes);
|
||||
if ($mname) { # if there is a MN
|
||||
foreach my $nodes (@servicenodes) {
|
||||
if ($mname ne ($nodes)){
|
||||
push @newservicenodes, $nodes;
|
||||
}
|
||||
}
|
||||
return @newservicenodes; # return without the MN in the array
|
||||
}
|
||||
}
|
||||
|
||||
return @servicenodes;
|
||||
}
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 get_ServiceNode
|
||||
|
||||
Will get the Service node ( name or ipaddress) as known by the Management
|
||||
Node or Node for the input nodename or ipadress of the node
|
||||
which can be a Service Node.
|
||||
If the input node is a Service Node then it's Service node
|
||||
is always the Management Node.
|
||||
|
||||
input: list of nodenames and/or node ipaddresses (array ref)
|
||||
service name
|
||||
"MN" or "Node" determines if you want the Service node as known
|
||||
by the Management Node or by the node.
|
||||
|
||||
recognized service names: xcat,tftpserver,
|
||||
nfsserver,conserver,monserver
|
||||
|
||||
service "xcat" is used by command like xdsh that need to know the
|
||||
service node that will process the command but are not tied to a
|
||||
specific service like tftp
|
||||
|
||||
Todo: Handle dhcpserver and nameserver from the networks table
|
||||
|
||||
output: A hash ref of arrays, the key is the service node pointing to
|
||||
an array of nodes that are serviced by that service node
|
||||
|
||||
Globals:
|
||||
$::ERROR_RC
|
||||
Error:
|
||||
$::ERROR_RC=0 no error $::ERROR_RC=1 error
|
||||
|
||||
example: $sn =xCAT::ServiceNodeUtils->get_ServiceNode(\@nodes,$service,"MN");
|
||||
$sn =xCAT::ServiceNodeUtils->get_ServiceNode(\@nodes,$service,"Node");
|
||||
Note: this rountine is important to hierarchical support in xCAT
|
||||
and used in many places. Any changes to the logic should be
|
||||
reviewed by xCAT architecture
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
sub get_ServiceNode
|
||||
{
|
||||
require xCAT::Table;
|
||||
my ($class, $node, $service, $request) = @_;
|
||||
my @node_list = @$node;
|
||||
my $cmd;
|
||||
my %snhash;
|
||||
my $nodehash;
|
||||
my $sn;
|
||||
my $nodehmtab;
|
||||
my $noderestab;
|
||||
my $snattribute;
|
||||
my $oshash;
|
||||
my $nodetab;
|
||||
$::ERROR_RC = 0;
|
||||
|
||||
# determine if the request is for the service node as known by the MN
|
||||
# or the node
|
||||
|
||||
if ($request eq "MN")
|
||||
{
|
||||
$snattribute = "servicenode";
|
||||
|
||||
}
|
||||
else # Node
|
||||
{
|
||||
$snattribute = "xcatmaster";
|
||||
}
|
||||
# get site.master this will be the default
|
||||
my $master = xCAT::TableUtils->get_site_Master();
|
||||
$noderestab = xCAT::Table->new('noderes');
|
||||
|
||||
unless ($noderestab) # no noderes table, use default site.master
|
||||
{
|
||||
xCAT::MsgUtils->message('I',
|
||||
"Unable to open noderes table. Using site->Master.\n");
|
||||
|
||||
if ($master) # use site Master value
|
||||
{
|
||||
|
||||
foreach my $node (@node_list)
|
||||
{
|
||||
push @{$snhash{$master}}, $node;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
xCAT::MsgUtils->message('E', "Unable to read site Master value.\n");
|
||||
$::ERROR_RC = 1;
|
||||
}
|
||||
|
||||
return \%snhash;
|
||||
}
|
||||
|
||||
if ($service eq "xcat")
|
||||
{ # find all service nodes for the nodes in the list
|
||||
|
||||
$nodehash = $noderestab->getNodesAttribs(\@node_list, [$snattribute]);
|
||||
|
||||
|
||||
foreach my $node (@node_list)
|
||||
{
|
||||
foreach my $rec (@{$nodehash->{$node}})
|
||||
{
|
||||
if ($rec and $rec->{$snattribute}) # use noderes.servicenode
|
||||
{
|
||||
my $key = $rec->{$snattribute};
|
||||
push @{$snhash{$key}}, $node;
|
||||
}
|
||||
else # use site.master
|
||||
{
|
||||
push @{$snhash{$master}}, $node;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$noderestab->close;
|
||||
return \%snhash;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (
|
||||
($service eq "tftpserver") # all from noderes table
|
||||
|| ($service eq "nfsserver") || ($service eq "monserver")
|
||||
)
|
||||
{
|
||||
$nodehash =
|
||||
$noderestab->getNodesAttribs(\@node_list,
|
||||
[$service, $snattribute]);
|
||||
foreach my $node (@node_list)
|
||||
{
|
||||
foreach my $rec (@{$nodehash->{$node}})
|
||||
{
|
||||
if ($rec and $rec->{$service})
|
||||
{
|
||||
|
||||
# see if both MN and Node address in attribute
|
||||
my ($msattr, $nodeattr) = split ':', $rec->{$service};
|
||||
my $key = $msattr;
|
||||
if ($request eq "Node")
|
||||
{
|
||||
if ($nodeattr) # override with Node, if it exists
|
||||
{
|
||||
$key = $nodeattr;
|
||||
}
|
||||
}
|
||||
push @{$snhash{$key}}, $node;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($rec and $rec->{$snattribute}) # if it exists
|
||||
{
|
||||
my $key = $rec->{$snattribute};
|
||||
push @{$snhash{$key}}, $node;
|
||||
}
|
||||
else
|
||||
{ # use site.master
|
||||
push @{$snhash{$master}}, $node;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$noderestab->close;
|
||||
return \%snhash;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($service eq "conserver")
|
||||
{
|
||||
|
||||
# read the nodehm table
|
||||
$nodehmtab = xCAT::Table->new('nodehm');
|
||||
unless ($nodehmtab) # no nodehm table
|
||||
{
|
||||
xCAT::MsgUtils->message('I',
|
||||
"Unable to open nodehm table.\n");
|
||||
|
||||
# use servicenode
|
||||
$nodehash =
|
||||
$noderestab->getNodesAttribs(\@node_list, [$snattribute]);
|
||||
foreach my $node (@node_list)
|
||||
{
|
||||
foreach my $rec (@{$nodehash->{$node}})
|
||||
{
|
||||
if ($rec and $rec->{$snattribute})
|
||||
{
|
||||
my $key = $rec->{$snattribute};
|
||||
push @{$snhash{$key}}, $node;
|
||||
}
|
||||
else
|
||||
{ # use site.master
|
||||
push @{$snhash{$master}}, $node;
|
||||
}
|
||||
}
|
||||
}
|
||||
$noderestab->close;
|
||||
return \%snhash;
|
||||
}
|
||||
|
||||
# can read the nodehm table
|
||||
$nodehash =
|
||||
$nodehmtab->getNodesAttribs(\@node_list, ['conserver']);
|
||||
foreach my $node (@node_list)
|
||||
{
|
||||
foreach my $rec (@{$nodehash->{$node}})
|
||||
{
|
||||
if ($rec and $rec->{'conserver'})
|
||||
{
|
||||
|
||||
# see if both MN and Node address in attribute
|
||||
my ($msattr, $nodeattr) = split ':',
|
||||
$rec->{'conserver'};
|
||||
my $key = $msattr;
|
||||
if ($request eq "Node")
|
||||
{
|
||||
if ($nodeattr
|
||||
) # override with Node, if it exists
|
||||
{
|
||||
$key = $nodeattr;
|
||||
}
|
||||
}
|
||||
push @{$snhash{$key}}, $node;
|
||||
}
|
||||
else
|
||||
{ # use service node for this node
|
||||
$sn =
|
||||
$noderestab->getNodeAttribs($node,
|
||||
[$snattribute]);
|
||||
if ($sn and $sn->{$snattribute})
|
||||
{
|
||||
my $key = $sn->{$snattribute};
|
||||
push @{$snhash{$key}}, $node;
|
||||
}
|
||||
else
|
||||
{ # no service node use master
|
||||
push @{$snhash{$master}}, $node;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$noderestab->close;
|
||||
$nodehmtab->close;
|
||||
return \%snhash;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
xCAT::MsgUtils->message('E',
|
||||
"Invalid service=$service input.\n");
|
||||
$::ERROR_RC = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return \%snhash;
|
||||
|
||||
}
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 getSNformattedhash
|
||||
|
||||
Will call get_ServiceNode to get the Service node ( name or ipaddress)
|
||||
as known by the Management
|
||||
Server or Node for the input nodename or ipadress of the node
|
||||
It will then format the output into a single servicenode key with values
|
||||
the list of nodes service by that service node. This routine will
|
||||
break up pools of service nodes into individual node in the hash unlike
|
||||
get_ServiceNode which leaves the pool as the key.
|
||||
|
||||
input: Same as get_ServiceNode to call get_ServiceNode
|
||||
list of nodenames and/or node ipaddresses (array ref)
|
||||
service name
|
||||
"MN" or "Node" determines if you want the Service node as known
|
||||
by the Management Node or by the node.
|
||||
|
||||
recognized service names: xcat,tftpserver,
|
||||
nfsserver,conserver,monserver
|
||||
|
||||
service "xcat" is used by command like xdsh that need to know the
|
||||
service node that will process the command but are not tied to a
|
||||
specific service like tftp
|
||||
|
||||
|
||||
output: A hash ref of arrays, the key is a single service node
|
||||
pointing to
|
||||
a list of nodes that are serviced by that service node
|
||||
'rra000-m'=>['blade01', 'testnode']
|
||||
'sn1'=>['blade01', 'testnode']
|
||||
'sn2'=>['blade01']
|
||||
'sn3'=>['testnode']
|
||||
|
||||
Globals:
|
||||
$::ERROR_RC
|
||||
Error:
|
||||
$::ERROR_RC=0 no error $::ERROR_RC=1 error
|
||||
|
||||
example: $sn =xCAT::ServiceNodeUtils->getSNformattedhash(\@nodes,$service,"MN", $type);
|
||||
$sn =xCAT::ServiceNodeUtils->getSNformattedhash(\@nodes,$service,"Node", "primary");
|
||||
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
sub getSNformattedhash
|
||||
{
|
||||
my ($class, $node, $service, $request, $btype) = @_;
|
||||
my @node_list = @$node;
|
||||
my $cmd;
|
||||
my %newsnhash;
|
||||
|
||||
my $type="";
|
||||
if ($btype) {
|
||||
$type=$btype;
|
||||
}
|
||||
|
||||
# get the values of either the servicenode or xcatmaster attributes
|
||||
my $sn = xCAT::ServiceNodeUtils->get_ServiceNode(\@node_list, $service, $request);
|
||||
|
||||
# get the keys which are the service nodes and break apart any pool lists
|
||||
# format into individual service node keys pointing to node lists
|
||||
if ($sn)
|
||||
{
|
||||
foreach my $snkey (keys %$sn)
|
||||
{
|
||||
# split the key if pool of service nodes
|
||||
push my @tmpnodes, $sn->{$snkey};
|
||||
my @nodes;
|
||||
for my $i (0 .. $#tmpnodes) {
|
||||
for my $j ( 0 .. $#{$tmpnodes[$i]}) {
|
||||
my $check=$tmpnodes[$i][$j];
|
||||
push @nodes,$check;
|
||||
}
|
||||
}
|
||||
|
||||
# for SN backup we might only want the primary or backup
|
||||
my @servicenodes;
|
||||
my ($primary, $backup) = split /,/, $snkey;
|
||||
if (($primary) && ($type eq "primary")) {
|
||||
push @servicenodes, $primary;
|
||||
} elsif (($backup) && ($type eq "backup")) {
|
||||
push @servicenodes, $backup;
|
||||
} else {
|
||||
@servicenodes = split /,/, $snkey;
|
||||
}
|
||||
|
||||
# now build new hash of individual service nodes
|
||||
foreach my $newsnkey (@servicenodes) {
|
||||
push @{$newsnhash{$newsnkey}}, @nodes;
|
||||
}
|
||||
}
|
||||
}
|
||||
return \%newsnhash;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head3 getAIXSNinterfaces
|
||||
|
||||
Get a list of ip addresses for each service node in a list
|
||||
|
||||
Arguments:
|
||||
list of service nodes
|
||||
Returns:
|
||||
hash of ips for each service node
|
||||
Globals:
|
||||
none
|
||||
Error:
|
||||
none
|
||||
Example:
|
||||
my $sni = xCAT::ServiceNodeUtils->getAIXSNinterfaces(\@servlist, $callback, $subreq);
|
||||
|
||||
Comments:
|
||||
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
sub getAIXSNinterfaces
|
||||
{
|
||||
my ($class, $list, $callback, $sub_req) = @_;
|
||||
|
||||
my @snlist = @$list;
|
||||
my %SNinterfaces;
|
||||
|
||||
# get all the possible IPs for the node I'm running on
|
||||
my $ifcmd = "/usr/sbin/ifconfig -a | grep 'inet ' ";
|
||||
foreach my $sn (@snlist)
|
||||
{
|
||||
my $SNIP;
|
||||
my $out = xCAT::InstUtils->xcmd($callback, $sub_req, "xdsh", $sn, $ifcmd, 0);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
my $rsp;
|
||||
push @{$rsp->{data}}, "Could not get IP addresses from service node $sn.\n";
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback);
|
||||
next;
|
||||
}
|
||||
|
||||
my @result;
|
||||
foreach my $line ( split(/\n/, $out)) {
|
||||
$line =~ s/$sn:\s+//;
|
||||
push(@result, $line);
|
||||
}
|
||||
|
||||
foreach my $int (@result) {
|
||||
my ($inet, $SNIP, $str) = split(" ", $int);
|
||||
chomp $SNIP;
|
||||
$SNIP =~ s/\/.*//; # ipv6 address 4000::99/64
|
||||
$SNIP =~ s/\%.*//; # ipv6 address ::1%1/128
|
||||
push(@{$SNinterfaces{$sn}}, $SNIP);
|
||||
}
|
||||
} # end foreach SN
|
||||
return \%SNinterfaces;
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3
|
||||
|
||||
getSNandCPnodes - Take an array of nodes and returns
|
||||
an array of the service
|
||||
nodes and an array of the computenode .
|
||||
|
||||
Arguments:
|
||||
none
|
||||
Returns:
|
||||
array of Service Nodes and/or array of compute nodesarray of compute nodes empty array, if none
|
||||
Globals:
|
||||
none
|
||||
Error:
|
||||
1 - error
|
||||
Example:
|
||||
xCAT::ServiceNodeUtils->getSNandCPnodes(\@nodes,\@SN,\@CN);
|
||||
Comments:
|
||||
none
|
||||
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
sub getSNandCPnodes
|
||||
{
|
||||
|
||||
my ($class, $nodes,$sn,$cn) = @_;
|
||||
my @nodelist = @$nodes;
|
||||
# get the list of all Service nodes
|
||||
my @allSN=xCAT::ServiceNodeUtils->getAllSN;
|
||||
foreach my $node (@nodelist) {
|
||||
if (grep(/^$node$/, @allSN)) { # it is a SN
|
||||
push (@$sn,$node);
|
||||
} else { # a CN
|
||||
push (@$cn,$node);
|
||||
}
|
||||
}
|
||||
|
||||
return ;
|
||||
}
|
||||
1;
|
||||
+153
-68
@@ -12,9 +12,7 @@
|
||||
# -cache to persist so long as '_build_cache' calls concurrently stack (for NodeRange interpretation mainly) (done)
|
||||
# -Allow plugins to define a staleness threshold for getNodesAttribs freshness (complicated enough to postpone...)
|
||||
# so that actions requested by disparate managed nodes may aggregate in SQL calls
|
||||
# cache lifetime is no longer determined strictly by function duration
|
||||
# now it can live up to 5 seconds. However, most calls will ignore the cache unless using a special option.
|
||||
# Hmm, potential issue, getNodesAttribs might return up to 5 second old data even if caller expects brand new data
|
||||
# reference count managed cache lifetime, if clear_cache is called, and build_chache has been called twice, decrement the counter
|
||||
# if called again, decrement again and clear cache
|
||||
# for getNodesAttribs, we can put a parameter to request allowable staleneess
|
||||
# if the cachestamp is too old, build_cache is called
|
||||
@@ -36,7 +34,7 @@
|
||||
package xCAT::Table;
|
||||
use xCAT::MsgUtils;
|
||||
use Sys::Syslog;
|
||||
use Storable qw/freeze thaw store_fd fd_retrieve/;
|
||||
use Storable qw/freeze thaw/;
|
||||
use IO::Socket;
|
||||
#use Data::Dumper;
|
||||
use POSIX qw/WNOHANG/;
|
||||
@@ -51,7 +49,10 @@ BEGIN
|
||||
# if AIX - make sure we include perl 5.8.2 in INC path.
|
||||
# Needed to find perl dependencies shipped in deps tarball.
|
||||
if ($^O =~ /^aix/i) {
|
||||
unshift(@INC, qw(/usr/opt/perl5/lib/5.8.2/aix-thread-multi /usr/opt/perl5/lib/5.8.2 /usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi /usr/opt/perl5/lib/site_perl/5.8.2));
|
||||
use lib "/usr/opt/perl5/lib/5.8.2/aix-thread-multi";
|
||||
use lib "/usr/opt/perl5/lib/5.8.2";
|
||||
use lib "/usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi";
|
||||
use lib "/usr/opt/perl5/lib/site_perl/5.8.2";
|
||||
}
|
||||
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
@@ -70,7 +71,7 @@ require xCAT::NotifHandler;
|
||||
|
||||
my $dbworkerpid; #The process id of the database worker
|
||||
my $dbworkersocket;
|
||||
my $dbsockpath = "/var/run/xcat/dbworker.sock.".$$;
|
||||
my $dbsockpath = "/tmp/xcat/dbworker.sock.".$$;
|
||||
my $exitdbthread;
|
||||
my $dbobjsforhandle;
|
||||
my $intendedpid;
|
||||
@@ -92,6 +93,8 @@ sub dbc_call {
|
||||
sub dbc_submit {
|
||||
my $request = shift;
|
||||
$request->{'wantarray'} = wantarray();
|
||||
my $data = freeze($request);
|
||||
$data.= "\nENDOFFREEZEQFVyo4Cj6Q0v\n";
|
||||
my $clisock;
|
||||
my $tries=300;
|
||||
while($tries and !($clisock = IO::Socket::UNIX->new(Peer => $dbsockpath, Type => SOCK_STREAM, Timeout => 120) ) ) {
|
||||
@@ -103,20 +106,22 @@ sub dbc_submit {
|
||||
use Carp qw/cluck/;
|
||||
cluck();
|
||||
}
|
||||
store_fd($request,$clisock);
|
||||
#print $clisock $data;
|
||||
my $data="";
|
||||
print $clisock $data;
|
||||
$data="";
|
||||
my $lastline="";
|
||||
my $retdata = fd_retrieve($clisock);
|
||||
while (read($clisock,$lastline,32768)) { #$lastline ne "ENDOFFREEZEQFVyo4Cj6Q0j\n" and $lastline ne "*XCATBUGDETECTED*76e9b54341\n") { #index($lastline,"ENDOFFREEZEQFVyo4Cj6Q0j") < 0) {
|
||||
# $lastline = <$clisock>;
|
||||
$data .= $lastline;
|
||||
}
|
||||
close($clisock);
|
||||
if (ref $retdata eq "SCALAR") { #bug detected
|
||||
if ($lastline =~ m/\*XCATBUGDETECTED\*76e9b54341\n\z/) { #if it was an error
|
||||
#in the midst of the operation, die like it used to die
|
||||
my $err;
|
||||
$$retdata =~ /\*XCATBUGDETECTED\*:(.*):\*XCATBUGDETECTED\*/s;
|
||||
$data =~ /\*XCATBUGDETECTED\*:(.*):\*XCATBUGDETECTED\*/s;
|
||||
$err = $1;
|
||||
die $err;
|
||||
}
|
||||
my @returndata = @{$retdata};
|
||||
my @returndata = @{thaw($data)};
|
||||
if (wantarray) {
|
||||
return @returndata;
|
||||
} else {
|
||||
@@ -159,7 +164,7 @@ sub init_dbworker {
|
||||
#This process is the database worker, it's job is to manage database queries to reduce required handles and to permit cross-process caching
|
||||
$0 = "xcatd: DB Access";
|
||||
use File::Path;
|
||||
mkpath('/var/run/xcat/');
|
||||
mkpath('/tmp/xcat/');
|
||||
use IO::Socket;
|
||||
$SIG{TERM} = $SIG{INT} = sub {
|
||||
$exitdbthread=1;
|
||||
@@ -197,7 +202,8 @@ sub init_dbworker {
|
||||
xCAT::MsgUtils->message("S","xcatd: possible BUG encountered by xCAT DB worker ".$err);
|
||||
if ($currcon) {
|
||||
eval { #avoid hang by allowin client to die too
|
||||
store_fd("*XCATBUGDETECTED*:$err:*XCATBUGDETECTED*\n",$currcon);
|
||||
print $currcon "*XCATBUGDETECTED*:$err:*XCATBUGDETECTED*\n";
|
||||
print $currcon "*XCATBUGDETECTED*76e9b54341\n";
|
||||
$clientset->remove($currcon);
|
||||
close($currcon);
|
||||
};
|
||||
@@ -208,10 +214,9 @@ sub init_dbworker {
|
||||
};
|
||||
if ($@) { #this should never be reached, but leave it intact just in case
|
||||
my $err=$@;
|
||||
eval { xCAT::MsgUtils->message("S","xcatd: possible BUG encountered by xCAT DB worker ".$err); };
|
||||
xCAT::MsgUtils->message("S","xcatd: possible BUG encountered by xCAT DB worker ".$err);
|
||||
}
|
||||
if ($intendedpid != $$) { #avoid redundant fork
|
||||
eval { xCAT::MsgUtils->message("S","Pid $$ shutting itself down because only pid $intendedpid is permitted to be in this area"); };
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
@@ -225,14 +230,13 @@ sub handle_dbc_conn {
|
||||
my $client = shift;
|
||||
my $clientset = shift;
|
||||
my $data;
|
||||
my $request;
|
||||
eval {
|
||||
$request = fd_retrieve($client);
|
||||
};
|
||||
if ($@ and $@ =~ /^Magic number checking on storable file/) { #this most likely means we ran over the end of available input
|
||||
$clientset->remove($client);
|
||||
close($client);
|
||||
} elsif ($request) {
|
||||
if ($data = <$client>) {
|
||||
my $lastline;
|
||||
while ($lastline ne "ENDOFFREEZEQFVyo4Cj6Q0v\n") { #$data !~ /ENDOFFREEZEQFVyo4Cj6Q0v/) {
|
||||
$lastline = <$client>;
|
||||
$data .= $lastline;
|
||||
}
|
||||
my $request = thaw($data);
|
||||
my $response;
|
||||
my @returndata;
|
||||
if ($request->{'wantarray'}) {
|
||||
@@ -240,7 +244,12 @@ sub handle_dbc_conn {
|
||||
} else {
|
||||
@returndata = (scalar(handle_dbc_request($request)));
|
||||
}
|
||||
store_fd(\@returndata,$client);
|
||||
$response = freeze(\@returndata);
|
||||
# $response .= "\nENDOFFREEZEQFVyo4Cj6Q0j\n";
|
||||
print $client $response;
|
||||
$clientset->remove($client);
|
||||
close($client);
|
||||
} else { #Connection terminated, clean up
|
||||
$clientset->remove($client);
|
||||
close($client);
|
||||
}
|
||||
@@ -351,6 +360,8 @@ sub handle_dbc_request {
|
||||
return $opentables{$tablename}->{$autocommit}->_set_use_cache(@args);
|
||||
} elsif ($functionname eq '_build_cache') {
|
||||
return $opentables{$tablename}->{$autocommit}->_build_cache(@args);
|
||||
} elsif ($functionname eq '_clear_cache') {
|
||||
return $opentables{$tablename}->{$autocommit}->_clear_cache(@args);
|
||||
} else {
|
||||
die "undefined function $functionname";
|
||||
}
|
||||
@@ -1603,7 +1614,7 @@ sub setAttribs
|
||||
# delimit the columns of the table
|
||||
my $delimitedcol = &delimitcol($col);
|
||||
$cols = $cols . $delimitedcol . " = ?,";
|
||||
push @bind, (($$elems{$col} eq "NULL") ? undef: $$elems{$col});
|
||||
push @bind, (($$elems{$col} =~ /NULL/) ? undef: $$elems{$col});
|
||||
}
|
||||
chop($cols);
|
||||
my $cmd ;
|
||||
@@ -1786,7 +1797,7 @@ sub setAttribsWhere
|
||||
# delimit the columns of the table
|
||||
my $delimitedcol = &delimitcol($col);
|
||||
$cols = $cols . $delimitedcol . " = ?,";
|
||||
push @bind, (($$elems{$col} eq "NULL") ? undef: $$elems{$col});
|
||||
push @bind, (($$elems{$col} =~ /NULL/) ? undef: $$elems{$col});
|
||||
}
|
||||
chop($cols);
|
||||
my $cmd = "UPDATE " . $self->{tabname} . " set $cols where " . $where_clause;
|
||||
@@ -2082,8 +2093,10 @@ sub getNodesAttribs {
|
||||
my @nodeentries=$self->getNodeAttribs($_,\@realattribs,%options);
|
||||
$rethash->{$_} = \@nodeentries; #$self->getNodeAttribs($_,\@attribs);
|
||||
}
|
||||
$self->_clear_cache;
|
||||
$self->{_use_cache} = 0;
|
||||
if ($self->{tabname} ne 'nodelist') {
|
||||
if ($self->{tabname} ne 'nodelist') { #avoid calling clear_cache on nodelist twice
|
||||
$self->{nodelist}->_clear_cache;
|
||||
$self->{nodelist}->{_use_cache} = 0;
|
||||
}
|
||||
return $rethash;
|
||||
@@ -2110,6 +2123,27 @@ sub _refresh_cache { #if cache exists, force a rebuild, leaving reference counts
|
||||
return;
|
||||
}
|
||||
|
||||
sub _clear_cache { #PRIVATE FUNCTION TO EXPIRE CACHED DATA EXPLICITLY
|
||||
#This is no longer sufficient to do at destructor time, as Table objects actually live an indeterminite amount of time now
|
||||
#TODO: only clear cache if ref count mentioned in build_cache is 1, otherwise decrement ref count
|
||||
my $self = shift;
|
||||
if ($dbworkerpid) {
|
||||
return dbc_call($self,'_clear_cache',@_);
|
||||
}
|
||||
if ($self->{_cache_ref} > 1) { #don't clear the cache if there are still live references
|
||||
$self->{_cache_ref} -= 1;
|
||||
return;
|
||||
} elsif ($self->{_cache_ref} == 1) { #If it is 1, decrement to zero and carry on
|
||||
return;
|
||||
#$self->{_cache_ref} = 0;
|
||||
}
|
||||
#it shouldn't have been zero, but whether it was 0 or 1, ensure that the cache is gone
|
||||
$self->{_use_cache}=0; # Signal slow operation to any in-flight operations that may fail with empty cache
|
||||
$self->{_cached_attriblist} = undef;
|
||||
undef $self->{_tablecache};
|
||||
undef $self->{_nodecache};
|
||||
}
|
||||
|
||||
sub _build_cache { #PRIVATE FUNCTION, PLEASE DON'T CALL DIRECTLY
|
||||
#TODO: increment a reference counter type thing to preserve current cache
|
||||
#Also, if ref count is 1 or greater, and the current cache is less than 3 seconds old, reuse the cache?
|
||||
@@ -2125,6 +2159,10 @@ sub _build_cache { #PRIVATE FUNCTION, PLEASE DON'T CALL DIRECTLY
|
||||
}
|
||||
|
||||
if (not $refresh and $self->{_cache_ref}) { #we have active cache reference, increment counter and return
|
||||
#TODO: ensure that the cache isn't somehow still ludirously old
|
||||
unless ($copts{noincrementref}) {
|
||||
$self->{_cache_ref} += 1;
|
||||
}
|
||||
my $currattr;
|
||||
my $cachesufficient=1;
|
||||
foreach $currattr (@$attriblist) { #if any of the requested attributes are not cached, we must rebuild
|
||||
@@ -2136,7 +2174,6 @@ sub _build_cache { #PRIVATE FUNCTION, PLEASE DON'T CALL DIRECTLY
|
||||
if ($self->{_cachestamp} < (time()-5)) { #NEVER use a cache older than 5 seconds
|
||||
$cachesufficient=0;
|
||||
}
|
||||
|
||||
if ($cachesufficient) { return; }
|
||||
#cache is insufficient, now we must do the converse of above
|
||||
#must add any currently cached columns to new list if not requested
|
||||
@@ -2271,16 +2308,16 @@ sub getNodeAttribs
|
||||
#skip undefined values, save time
|
||||
next;
|
||||
}
|
||||
|
||||
if ($datum->{$attrib} =~ /^\/[^\/]*\/[^\/]*\/$/)
|
||||
{
|
||||
my $exp = substr($datum->{$attrib}, 1);
|
||||
chop $exp;
|
||||
my @parts = split('/', $exp, 2);
|
||||
my $retval = $node;
|
||||
$retval =~ s/$parts[0]/$parts[1]/;
|
||||
$datum->{$attrib} = $retval;
|
||||
$node =~ s/$parts[0]/$parts[1]/;
|
||||
$datum->{$attrib} = $node;
|
||||
}
|
||||
elsif ($datum->{$attrib} =~ /^\|.*\|$/)
|
||||
elsif ($datum->{$attrib} =~ /^\|.*\|.*\|$/)
|
||||
{
|
||||
|
||||
#Perform arithmetic and only arithmetic operations in bracketed issues on the right.
|
||||
@@ -2290,14 +2327,6 @@ sub getNodeAttribs
|
||||
my $exp = substr($datum->{$attrib}, 1);
|
||||
chop $exp;
|
||||
my @parts = split('\|', $exp, 2);
|
||||
my $arraySize = @parts;
|
||||
if ($arraySize < 2) { # easy regx, generate lhs from node
|
||||
my $lhs;
|
||||
my @numbers = $node =~ m/[\D0]*(\d+)/g;
|
||||
$lhs = '[\D0]*(\d+)' x scalar(@numbers);
|
||||
$lhs .= '.*$';
|
||||
unshift(@parts,$lhs);
|
||||
}
|
||||
my $curr;
|
||||
my $next;
|
||||
my $prev;
|
||||
@@ -2349,6 +2378,71 @@ sub getNodeAttribs
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
=head3 getNodeSpecAttribs
|
||||
Description: Retrieves the requested attributes which matching the specified options for a node
|
||||
Arguments:
|
||||
Noderange
|
||||
The specified options
|
||||
List of attributes
|
||||
Return:
|
||||
Attribute hash
|
||||
Example:
|
||||
my $tab = xCAT::Table->new('ppcdirect');
|
||||
my $ent = $tab->getNodeSpecAttribs($node, {username=>'HMC'}, qw/password/);
|
||||
Comments:
|
||||
The keys of the specified options can be given in the list of attributes or not,
|
||||
this routine will deal with them.
|
||||
=cut
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
#sub getNodeSpecAttribs {
|
||||
# my $self = shift;
|
||||
# my $node = shift;
|
||||
# my %options = ();
|
||||
# my @attribs = ();
|
||||
# my @keys = ();
|
||||
# if (ref $_[0] eq 'HASH') {
|
||||
# %options = %{shift()};
|
||||
# @attribs = @_;
|
||||
# foreach my $key (keys %options) {
|
||||
# if (!grep(/^$key$/, @attribs)) {
|
||||
# push @attribs, $key;
|
||||
# }
|
||||
# }
|
||||
# } else {
|
||||
# @attribs = @_;
|
||||
# }
|
||||
# if ((keys (%options)) == 0) {
|
||||
# my $ent = $self->getNodeAttribs($node, \@attribs);
|
||||
# return $ent;
|
||||
# } else {
|
||||
# my $nodekey = "node";
|
||||
# if (defined $xCAT::Schema::tabspec{$self->{tabname}}->{nodecol}) {
|
||||
# $nodekey = $xCAT::Schema::tabspec{$self->{tabname}}->{nodecol};
|
||||
# }
|
||||
# $options{$nodekey} = $node;
|
||||
# my $ent = $self->getAttribs(\%options, \@attribs);
|
||||
# if ($ent) {
|
||||
# return $ent;
|
||||
# }
|
||||
# my ($nodeghash) = $self->{nodelist}->getAttribs({node=>$node}, "groups");
|
||||
# unless(defined($nodeghash) && defined($nodeghash->{groups})) {
|
||||
# return undef;
|
||||
# }
|
||||
# my @nodegroups = split(/,/, $nodeghash->{groups});
|
||||
# foreach my $group (@nodegroups) {
|
||||
# $options{$nodekey} = $group;
|
||||
# my $g_ret = $self->getAttribs(\%options, \@attribs);
|
||||
# if ($g_ret) {
|
||||
# return $g_ret;
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
# return undef;
|
||||
#}
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
=head3 getNodeAttribs_nosub
|
||||
|
||||
Description:
|
||||
@@ -2834,9 +2928,7 @@ sub getAllAttribsWhere
|
||||
|
||||
Arguments:
|
||||
Table handle
|
||||
Attribute list
|
||||
optional hash return style
|
||||
( changes the return hash structure format)
|
||||
Attribute list
|
||||
Returns:
|
||||
Array of attribute values
|
||||
Globals:
|
||||
@@ -2844,8 +2936,7 @@ sub getAllAttribsWhere
|
||||
Error:
|
||||
|
||||
Example:
|
||||
my @entries = $self->{switchtab}->getAllNodeAttribs(['port','switch']);
|
||||
my @entries = $self->{switchtab}->getAllNodeAttribs(['port','switch'],1);
|
||||
my @entries = $self->{switchtab}->getAllNodeAttribs(['port','switch']);
|
||||
Comments:
|
||||
none
|
||||
|
||||
@@ -2884,6 +2975,8 @@ sub getAllNodeAttribs
|
||||
unless ($options{prefetchcache}) {
|
||||
$self->{_use_cache} = 0;
|
||||
$self->{nodelist}->{_use_cache}=0;
|
||||
$self->_clear_cache();
|
||||
$self->{nodelist}->_clear_cache();
|
||||
}
|
||||
$self->_build_cache($attribq);
|
||||
$self->{nodelist}->_build_cache(['node','groups']);
|
||||
@@ -2902,14 +2995,10 @@ sub getAllNodeAttribs
|
||||
$self->{nrcache}->{$data->{$nodekey}}->{tstamp} = time();
|
||||
}
|
||||
@nodes = @{$self->{nrcache}->{$data->{$nodekey}}->{value}}; #expand node entry, to make groups expand
|
||||
|
||||
#If node not in nodelist do not add to the hash (SF 3580)
|
||||
#unless (@nodes) { #in the event of an entry not in nodelist, use entry value verbatim
|
||||
# @nodes = ($data->{$nodekey});
|
||||
#} end SF 3580
|
||||
|
||||
unless (@nodes) { #in the event of an entry not in nodelist, use entry value verbatim
|
||||
@nodes = ($data->{$nodekey});
|
||||
}
|
||||
#my $localhash = $self->getNodesAttribs(\@nodes,$attribq); #NOTE: This is stupid, rebuilds the cache for every entry, FIXME
|
||||
|
||||
foreach (@nodes)
|
||||
{
|
||||
if ($donenodes{$_}) { next; }
|
||||
@@ -2941,8 +3030,11 @@ sub getAllNodeAttribs
|
||||
}
|
||||
}
|
||||
}
|
||||
$self->_clear_cache();
|
||||
$self->{nodelist}->_clear_cache();
|
||||
$self->{_use_cache} = 0;
|
||||
$self->{nodelist}->{_use_cache} = 0;
|
||||
xCAT::NodeRange::retain_cache(0);
|
||||
$query->finish();
|
||||
if ($hashretstyle) {
|
||||
return $rethash;
|
||||
@@ -3058,18 +3150,11 @@ sub getAllAttribs
|
||||
Error:
|
||||
|
||||
Example:
|
||||
my $table=xCAT::Table->new("nodelist");
|
||||
my %keyhash;
|
||||
$keyhash{node} = "node1";
|
||||
$keyhash{groups} = "compute1";
|
||||
$table->delEntries(\%keyhash);
|
||||
$table->commit;
|
||||
Build delete statement and'ing the elements of the hash
|
||||
DELETE FROM nodelist WHERE ("groups" = "compute1" AND "node" = "node1")
|
||||
my $table=xCAT::Table->new("notification", -create => 1,-autocommit => 0);
|
||||
my %key_col = (filename=>$fname);
|
||||
$table->delEntries(\%key_col);
|
||||
$table->commit;
|
||||
|
||||
If called with no attributes, it will delete all entries in the table.
|
||||
$table->delEntries();
|
||||
$table->commit;
|
||||
Comments:
|
||||
none
|
||||
|
||||
@@ -3206,7 +3291,7 @@ sub getAttribs
|
||||
{
|
||||
|
||||
#Takes two arguments:
|
||||
#-Key(s) name (will be compared against the table key(s) value)
|
||||
#-Node name (will be compared against the 'Node' column)
|
||||
#-List reference of attributes for which calling code wants at least one of defined
|
||||
# (recurse argument intended only for internal use.)
|
||||
# Returns a hash reference with requested attributes defined.
|
||||
@@ -3836,7 +3921,7 @@ sub writeAllEntries
|
||||
# open the file for write
|
||||
unless (open($fh," > $filename")) {
|
||||
my $msg="Unable to open $filename for write \n.";
|
||||
`logger -p local4.err -t xcat $msg`;
|
||||
`logger -t xcat $msg`;
|
||||
return 1;
|
||||
}
|
||||
my $query;
|
||||
@@ -3921,7 +4006,7 @@ sub writeAllAttribsWhere
|
||||
# open the file for write
|
||||
unless (open($fh," > $filename")) {
|
||||
my $msg="Unable to open $filename for write \n.";
|
||||
`logger -p local4.err -t xcat $msg`;
|
||||
`logger -t xcat $msg`;
|
||||
return 1;
|
||||
}
|
||||
my $header;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+22
-42
@@ -36,13 +36,11 @@ my %usage = (
|
||||
LPAR(using Direct FSP Management) specific:
|
||||
rpower <noderange> [on|off|reset|stat|state|boot|of|sms]
|
||||
Blade(using Direct FSP Management) specific:
|
||||
rpower <noderange> [on|onstandby|off|cycle|state|sms]
|
||||
rpower <noderange> [on|off|cycle|state]
|
||||
Blade(using AMM) specific:
|
||||
rpower <noderange> [cycle|softoff] [-V|--verbose]
|
||||
zVM specific:
|
||||
rpower noderange [on|off|reset|stat|softoff]
|
||||
MIC specific:
|
||||
rpower noderange [stat|state|on|off|reset|boot]
|
||||
",
|
||||
"rbeacon" =>
|
||||
"Usage: rbeacon <noderange> [on|off|stat] [-V|--verbose]
|
||||
@@ -60,11 +58,9 @@ my %usage = (
|
||||
Blade specific:
|
||||
rvitals noderange {temp|wattage|fanspeed|leds|summary|all}
|
||||
BMC specific:
|
||||
rvitals noderange {temp|voltage|wattage|fanspeed|power|leds|lcds|summary|all}
|
||||
MIC specific:
|
||||
rvitals noderange {thermal|all}",
|
||||
rvitals noderange {temp|voltage|wattage|fanspeed|power|leds|lcds|summary|all}",
|
||||
"reventlog" =>
|
||||
"Usage: reventlog <noderange> [all [-s]|clear|<number of entries to retrieve> [-s]] [-V|--verbose]
|
||||
"Usage: reventlog <noderange> [all|clear|<number of entries to retrieve>] [-V|--verbose]
|
||||
reventlog [-h|--help|-v|--version]",
|
||||
"rinv" =>
|
||||
"Usage:
|
||||
@@ -87,16 +83,14 @@ my %usage = (
|
||||
VMware specific:
|
||||
rinv <noderange>
|
||||
zVM specific:
|
||||
rinv noderange [all|config]
|
||||
MIC specific:
|
||||
rinv noderange [system|ver|board|core|gddr|all]",
|
||||
rinv noderange [all|config]",
|
||||
"rsetboot" =>
|
||||
"Usage: rsetboot <noderange> [net|hd|cd|floppy|def|stat] [-V|--verbose]
|
||||
rsetboot [-h|--help|-v|--version]",
|
||||
"rbootseq" =>
|
||||
"Usage:
|
||||
Common:
|
||||
rbootseq [-h|--help|-v|--version|-V|--verbose]
|
||||
rbootseq [-h|--help|-v|--version]
|
||||
Blade specific:
|
||||
rbootseq <noderange> [hd0|hd1|hd2|hd3|net|iscsi|usbflash|floppy|none],...
|
||||
PPC (using Direct FSP Management) specific:
|
||||
@@ -107,7 +101,7 @@ my %usage = (
|
||||
"rspconfig" =>
|
||||
"Usage:
|
||||
Common:
|
||||
rspconfig [-h|--help|-v|--version|-V|--verbose]
|
||||
rspconfig [-h|--help|-v|--version]
|
||||
BMC/MPA Common:
|
||||
rspconfig <noderange> [snmpdest|alert|community] [-V|--verbose]
|
||||
rspconfig <noderange> [snmpdest=<dest ip address>|alert=<on|off|en|dis|enable|disable>|community=<string>]
|
||||
@@ -121,7 +115,7 @@ my %usage = (
|
||||
rspconfig <noderange> [sshcfg|snmpcfg|pd1|pd2|network|swnet|ntp|textid|frame]
|
||||
rspconfig <singlenode> [textid=name]
|
||||
rspconfig <singlenode> [frame=number]
|
||||
rspconfig <singlenode> [USERID=passwd] [updateBMC=<y|n>]
|
||||
rspconfig <singlenode> [USERID=passwd]
|
||||
rspconfig <noderange> [sshcfg=<enable|disable>|
|
||||
snmpcfg=<enable|disable>|
|
||||
pd1=<nonred|redwoperf|redwperf>|
|
||||
@@ -191,7 +185,7 @@ my %usage = (
|
||||
PPC specific:
|
||||
getmacs <noderange> [-F filter]
|
||||
getmacs <noderange> [-M]
|
||||
getmacs <noderange> [-V| --verbose] [-f] [-d] [--arp] | [-D [-o] [-S server] [-G gateway] [-C client]]
|
||||
getmacs <noderange> [-V| --verbose] [-f] [-d] [--arp] | [-D [-S server] [-G gateway] [-C client]]
|
||||
blade specific:
|
||||
getmacs <noderange> [-V| --verbose] [-d] [--arp] [-i ethN|enN]
|
||||
",
|
||||
@@ -267,7 +261,7 @@ my %usage = (
|
||||
rmvm [-p] [-f]",
|
||||
"lsslp" =>
|
||||
"Usage: lsslp [-h|--help|-v|--version]
|
||||
lsslp [<noderange>][-V|--verbose][-i ip[,ip..]][-w][-r|-x|-z][-n][-I][-s FRAME|CEC|MM|IVM|RSA|HMC|CMM|IMM2|FSP]
|
||||
lsslp [<noderange>][-V|--verbose][-i ip[,ip..]][-w][-r|-x|-z][-n][-I][-s FRAME|CEC|MM|IVM|RSA|HMC|CMM]
|
||||
[-t tries][--vpdtable][-C counts][-T timeout]",
|
||||
"rflash" =>
|
||||
"Usage:
|
||||
@@ -278,7 +272,7 @@ my %usage = (
|
||||
PPC (using Direct FSP Management) specific:
|
||||
rflash <noderange> -p <rpm_directory> --activate <disruptive|deferred> [-d <data_directory>]
|
||||
rflash <noderange> [--commit | --recover] [-V|--verbose]
|
||||
rflash <noderange> [--bpa_acdl]",
|
||||
rflash <noderange> [--bpa_acdl]",
|
||||
"mkhwconn" =>
|
||||
"Usage:
|
||||
mkhwconn [-h|--help]
|
||||
@@ -323,31 +317,20 @@ my %usage = (
|
||||
renergy noderange [-V] { all | { [savingstatus] [dsavingstatus] [cappingstatus] [cappingmaxmin] [cappingvalue] [cappingsoftmin] [averageAC] [averageDC] [ambienttemp] [exhausttemp] [CPUspeed] [syssbpower] [sysIPLtime] [fsavingstatus] [ffoMin] [ffoVmin] [ffoTurbo] [ffoNorm] [ffovalue] } }
|
||||
renergy noderange [-V] { {savingstatus}={on | off} | {dsavingstatus}={on-norm | on-maxp | off} | {fsavingstatus}={on | off} | {ffovalue}=MHZ | {cappingstatus}={on | off} | {cappingwatt}=watt | {cappingperc}=percentage }
|
||||
|
||||
BladeCenter specific :
|
||||
For Management Modules:
|
||||
renergy noderange [-V] { all | pd1all | pd2all | [pd1status] [pd2status] [pd1policy] [pd2policy] [pd1powermodule1] [pd1powermodule2] [pd2powermodule1] [pd2powermodule2] [pd1avaiablepower] [pd2avaiablepower] [pd1reservedpower] [pd2reservedpower] [pd1remainpower] [pd2remainpower] [pd1inusedpower] [pd2inusedpower] [availableDC] [averageAC] [thermaloutput] [ambienttemp] [mmtemp] }
|
||||
For a blade server nodes:
|
||||
renergy noderange [-V] { all | [averageDC] [capability] [cappingvalue] [CPUspeed] [maxCPUspeed] [savingstatus] [dsavingstatus] }
|
||||
renergy noderange [-V] { savingstatus={on | off} | dsavingstatus={on-norm | on-maxp | off} }
|
||||
|
||||
Flex specific :
|
||||
For Flex Management Modules:
|
||||
renergy noderange [-V] { all | [powerstatus] [powerpolicy] [powermodule] [avaiablepower] [reservedpower] [remainpower] [inusedpower] [availableDC] [averageAC] [thermaloutput] [ambienttemp] [mmtemp] }
|
||||
|
||||
For Flex node (power and x86):
|
||||
renergy noderange [-V] { all | [averageDC] [capability] [cappingvalue] [cappingmaxmin] [cappingmax] [cappingmin] [cappingGmin] [CPUspeed] [maxCPUspeed] [savingstatus] [dsavingstatus] }
|
||||
renergy noderange [-V] { cappingstatus={on | off} | cappingwatt=watt | cappingperc=percentage | savingstatus={on | off} | dsavingstatus={on-norm | on-maxp | off} }
|
||||
|
||||
iDataPlex specific :
|
||||
renergy noderange [-V] [ { cappingmaxmin | cappingmax | cappingmin } ] [cappingstatus] [cappingvalue] [relhistogram]
|
||||
renergy noderange [-V] { cappingstatus={on | enable | off | disable} | {cappingwatt|cappingvalue}=watt }",
|
||||
Blade specific :
|
||||
renergy noderange [-V] { all | pd1all | pd2all | { [pd1status] [pd2status] [pd1policy] [pd2policy] [pd1powermodule1] [pd1powermodule2] [pd2powermodule1] [pd2powermodule2] [pd1avaiablepower] [pd2avaiablepower] [pd1reservedpower] [pd2reservedpower] [pd1remainpower] [pd2remainpower] [pd1inusedpower] [pd2inusedpower] [availableDC] [averageAC] [thermaloutput] [ambienttemp] [mmtemp] } }
|
||||
renergy noderange [-V] { all | { [averageDC] [capability] [cappingvalue] [CPUspeed] [maxCPUspeed] [savingstatus] [dsavingstatus] } }
|
||||
renergy noderange [-V] { {savingstatus}={on | off} | {dsavingstatus}={on-norm | on-maxp | off} }",
|
||||
"updatenode" =>
|
||||
"Usage:
|
||||
updatenode [-h|--help|-v|--version]
|
||||
or
|
||||
updatenode <noderange> [-V|--verbose] [-k|--security] [-s|--sn]
|
||||
or
|
||||
updatenode <noderange> [-V|--verbose] [-F|--sync | -f|--snsync] [-l|--user[username]] [--fanout=[fanout value]] [-S|--sw]
|
||||
updatenode <noderange> [-V|--verbose] [-k|--security] [--user]
|
||||
[--devicetype]
|
||||
or
|
||||
updatenode <noderange> [-V|--verbose] [-F|--sync | -f|--snsync] [-S|--sw]
|
||||
[-P|--scripts [script1,script2,...]] [-s|--sn]
|
||||
[-A|--updateallsw] [-c|--cmdlineonly] [-d alt_source_dir]
|
||||
[attr=val [attr=val...]]
|
||||
@@ -360,17 +343,14 @@ Options:
|
||||
[-k|--security] Update the security keys and certificates for the
|
||||
target nodes.
|
||||
|
||||
[-F|--sync] Perform File Syncing.
|
||||
[-k|--security] [--user] [--devicetype] Update the ssh keys for
|
||||
specific device.
|
||||
|
||||
[--fanout] Allows you to assign the fanout value for the command.
|
||||
See xdsh/xdcp fanout parameter in the man page.
|
||||
[-F|--sync] Perform File Syncing.
|
||||
|
||||
[-f|--snsync] Performs File Syncing to the service nodes that service
|
||||
the nodes in the noderange.
|
||||
|
||||
[-l|--user] User name to run the updatenode command. It overrides the
|
||||
current user which is the default.
|
||||
|
||||
[-S|--sw] Perform Software Maintenance.
|
||||
|
||||
[-P|--scripts] Execute postscripts listed in the postscripts table or
|
||||
@@ -405,7 +385,7 @@ Options:
|
||||
"Usage:
|
||||
Common:
|
||||
nodeset [-h|--help|-v|--version]
|
||||
nodeset <noderange> [install|shell|boot|runcmd=bmcsetup|netboot|iscsiboot|osimage[=<imagename>]|statelite|offline]",
|
||||
nodeset <noderange> [install|shell|boot|runcmd=bmcsetup|netboot|iscsiboot|osimage=<imagename>|statelite|offline]",
|
||||
"rmflexnode" =>
|
||||
"Usage:
|
||||
rmflexnode [-h|--help|-v|--version]
|
||||
|
||||
+3605
-515
File diff suppressed because it is too large
Load Diff
@@ -10,7 +10,10 @@ BEGIN
|
||||
# if AIX - make sure we include perl 5.8.2 in INC path.
|
||||
# Needed to find perl dependencies shipped in deps tarball.
|
||||
if ($^O =~ /^aix/i) {
|
||||
unshift(@INC, qw(/usr/opt/perl5/lib/5.8.2/aix-thread-multi /usr/opt/perl5/lib/5.8.2 /usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi /usr/opt/perl5/lib/site_perl/5.8.2));
|
||||
use lib "/usr/opt/perl5/lib/5.8.2/aix-thread-multi";
|
||||
use lib "/usr/opt/perl5/lib/5.8.2";
|
||||
use lib "/usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi";
|
||||
use lib "/usr/opt/perl5/lib/site_perl/5.8.2";
|
||||
}
|
||||
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
@@ -38,7 +41,7 @@ use strict;
|
||||
sub Version
|
||||
{
|
||||
|
||||
#The following tags tells the build script where to append build info
|
||||
#The following tag tells the build script where to append build info
|
||||
my $version = shift;
|
||||
if ($version eq 'short')
|
||||
{
|
||||
|
||||
+2
-22
@@ -18,24 +18,9 @@ sub localize_yumrepo {
|
||||
$installpfx = "$installroot/$distname/$arch";
|
||||
mkpath("$installroot/postscripts/repos/$distname/$arch/");
|
||||
open($yumrepofile,">","$installroot/postscripts/repos/$distname/$arch/local-repository.tmpl");
|
||||
my %options=(
|
||||
wanted => \&check_tofix,
|
||||
follow_fast => 1
|
||||
);
|
||||
find(\%options,$installpfx);
|
||||
close($yumrepofile);
|
||||
find(\&check_tofix,$installpfx);
|
||||
close($yumrepofile);
|
||||
}
|
||||
|
||||
|
||||
sub remove_yumrepo {
|
||||
my $self = shift;
|
||||
my $installroot = shift;
|
||||
$distname = shift;
|
||||
$arch = shift;
|
||||
|
||||
rmtree("$installroot/postscripts/repos/$distname/$arch/");
|
||||
}
|
||||
|
||||
sub check_tofix {
|
||||
if (-d $File::Find::name and $File::Find::name =~ /\/repodata$/) {
|
||||
if($distname =~ /rhels5/)
|
||||
@@ -44,12 +29,7 @@ sub check_tofix {
|
||||
}
|
||||
generate_repo($File::Find::name);
|
||||
}
|
||||
elsif($File::Find::name =~ /\/RPM-GPG-KEY/){
|
||||
qx(rpm --import $File::Find::name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sub generate_repo
|
||||
{
|
||||
#write local-repository.tmpl
|
||||
|
||||
Executable → Regular
+14
-21
@@ -1,10 +1,9 @@
|
||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
# You can get copycds to recognize new distro DVDs/ISOs (so that you do not have to specify -n and -a)
|
||||
# by adding the disc ids to the %distnames hash below. Follow the syntax carefully.
|
||||
# Reload xcatd to have it take affect (service xcatd reload).
|
||||
|
||||
package xCAT::data::discinfo;
|
||||
#BEGIN
|
||||
#{
|
||||
# $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
|
||||
#}
|
||||
|
||||
require Exporter;
|
||||
@ISA=qw(Exporter);
|
||||
@@ -12,11 +11,11 @@ require Exporter;
|
||||
@EXPORT_OK=qw(distnames numdiscs);
|
||||
|
||||
|
||||
|
||||
|
||||
%distnames = (
|
||||
"1310229985.226287" => "centos6",
|
||||
"1323560292.885204" => "centos6.2",
|
||||
"1341569670.539525" => "centos6.3",#x86
|
||||
"1362445555.957609" => "centos6.4",#x86_64
|
||||
"1176234647.982657" => "centos5",
|
||||
"1156364963.862322" => "centos4.4",
|
||||
"1178480581.024704" => "centos4.5",
|
||||
@@ -26,8 +25,6 @@ require Exporter;
|
||||
"1214240246.285059" => "centos5.2",
|
||||
"1237641529.260981" => "centos5.3",
|
||||
"1272326751.405938" => "centos5.5",
|
||||
"1330913492.861127" => "centos5.8",#x86_64
|
||||
"1357930415.252042" => "centos5.9",#x86_64
|
||||
"1195488871.805863" => "centos4.6",
|
||||
"1195487524.127458" => "centos4.6",
|
||||
"1301444731.448392" => "centos5.6",
|
||||
@@ -46,9 +43,6 @@ require Exporter;
|
||||
"1269262918.904535" => "rhels5.5", #ppc
|
||||
"1269260915.992102" => "rhels5.5", #i386
|
||||
"1269263646.691048" => "rhels5.5", #x86_64
|
||||
"1328205744.315196" => "rhels5.8", #x86_64
|
||||
"1354216429.587870" => "rhels5.9", #x86_64
|
||||
"1354214009.518521" => "rhels5.9", #ppc64
|
||||
"1285193176.460470" => "rhels6", #x86_64
|
||||
"1285192093.430930" => "rhels6", #ppc64
|
||||
"1305068199.328169" => "rhels6.1", #x86_64
|
||||
@@ -56,15 +50,9 @@ require Exporter;
|
||||
"1321546114.510099" => "rhels6.2", #x86_64
|
||||
"1321546739.676170" => "rhels6.2", #ppc64
|
||||
"1339641244.734735" => "rhels6.3", #ppc64
|
||||
"1339640147.274118" => "rhels6.3", #x86_64
|
||||
"1339638991.532890" => "rhels6.3", #i386
|
||||
"1359576752.435900" => "rhels6.4", #x86_64
|
||||
"1359576196.686790" => "rhels6.4", #ppc64
|
||||
"1285193176.593806" => "rhelhpc6", #x86_64
|
||||
"1305067719.718814" => "rhelhpc6.1",#x86_64
|
||||
"1321545261.599847" => "rhelhpc6.2",#x86_64
|
||||
"1339640148.070971" => "rhelhpc6.3",#x86_64
|
||||
"1359576195.413831" => "rhelhpc6.4",#x86_64, RHEL ComputeNode
|
||||
"1339640147.274118" => "rhels6.3", #x86_64
|
||||
"1339638991.532890" => "rhels6.3", #i386
|
||||
"1285193176.593806" => "rhelhpc6",
|
||||
"1194015916.783841" => "fedora8",
|
||||
"1194015385.299901" => "fedora8",
|
||||
"1210112435.291709" => "fedora9",
|
||||
@@ -90,4 +78,9 @@ my %numdiscs = (
|
||||
);
|
||||
|
||||
|
||||
#sub handled_commands
|
||||
#{
|
||||
# return;
|
||||
#};
|
||||
|
||||
1;
|
||||
|
||||
@@ -14,7 +14,7 @@ package xCAT::hpoa;
|
||||
|
||||
use strict;
|
||||
|
||||
#use SOAP::Lite; # hpblade.pm requires SOAP::Lite before requiring hpoa.pm, so we can check for SOAP::Lite dynamically
|
||||
use SOAP::Lite;
|
||||
use vars qw(@ISA);
|
||||
@ISA = qw(SOAP::Lite);
|
||||
|
||||
|
||||
+82
-308
@@ -1,4 +1,4 @@
|
||||
# IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
# IBM(c) 2012 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head1
|
||||
@@ -19,8 +19,7 @@ use warnings;
|
||||
=head3 getUserId
|
||||
|
||||
Description : Get the user ID of a given node
|
||||
Arguments : User (root or non-root)
|
||||
Node
|
||||
Arguments : Node
|
||||
Returns : UserID
|
||||
Example : my $userID = xCAT::zvmCPUtils->getUserId($node);
|
||||
|
||||
@@ -30,15 +29,10 @@ use warnings;
|
||||
sub getUserId {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $user, $node ) = @_;
|
||||
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
$sudo = "";
|
||||
}
|
||||
my ( $class, $node ) = @_;
|
||||
|
||||
# Get user ID using VMCP
|
||||
my $out = `ssh -o ConnectTimeout=5 $user\@$node "$sudo /sbin/vmcp q userid"`;
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q userid"`;
|
||||
my @results = split( ' ', $out );
|
||||
|
||||
return ( $results[0] );
|
||||
@@ -49,8 +43,7 @@ sub getUserId {
|
||||
=head3 getHost
|
||||
|
||||
Description : Get the z/VM host of a given node
|
||||
Arguments : User (root or non-root)
|
||||
Node
|
||||
Arguments : Node
|
||||
Returns : z/VM host
|
||||
Example : my $host = xCAT::zvmCPUtils->getHost($node);
|
||||
|
||||
@@ -60,15 +53,10 @@ sub getUserId {
|
||||
sub getHost {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $user, $node ) = @_;
|
||||
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
$sudo = "";
|
||||
}
|
||||
my ( $class, $node ) = @_;
|
||||
|
||||
# Get host using VMCP
|
||||
my $out = `ssh -o ConnectTimeout=5 $user\@$node "$sudo /sbin/vmcp q userid"`;
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q userid"`;
|
||||
my @results = split( ' ', $out );
|
||||
my $host = $results[2];
|
||||
|
||||
@@ -80,8 +68,7 @@ sub getHost {
|
||||
=head3 getPrivileges
|
||||
|
||||
Description : Get the privilege class of a given node
|
||||
Arguments : User (root or non-root)
|
||||
Node
|
||||
Arguments : Node
|
||||
Returns : Privilege class
|
||||
Example : my $class = xCAT::zvmCPUtils->getPrivileges($node);
|
||||
|
||||
@@ -91,15 +78,10 @@ sub getHost {
|
||||
sub getPrivileges {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $user, $node ) = @_;
|
||||
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
$sudo = "";
|
||||
}
|
||||
my ( $class, $node ) = @_;
|
||||
|
||||
# Get privilege class
|
||||
my $out = `ssh -o ConnectTimeout=5 $user\@$node "$sudo /sbin/vmcp q priv"`;
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q priv"`;
|
||||
my @out = split( '\n', $out );
|
||||
$out[1] = xCAT::zvmUtils->trimStr( $out[1] );
|
||||
$out[2] = xCAT::zvmUtils->trimStr( $out[2] );
|
||||
@@ -113,8 +95,7 @@ sub getPrivileges {
|
||||
=head3 getMemory
|
||||
|
||||
Description : Get the memory of a given node
|
||||
Arguments : User (root or non-root)
|
||||
Node
|
||||
Arguments : Node
|
||||
Returns : Memory
|
||||
Example : my $memory = xCAT::zvmCPUtils->getMemory($node);
|
||||
|
||||
@@ -124,29 +105,21 @@ sub getPrivileges {
|
||||
sub getMemory {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $user, $node ) = @_;
|
||||
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
$sudo = "";
|
||||
}
|
||||
my ( $class, $node ) = @_;
|
||||
|
||||
# Get memory
|
||||
my $out = `ssh -o ConnectTimeout=5 $user\@$node "$sudo /sbin/vmcp q virtual storage"`;
|
||||
my @out = split( ' ', $out );
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q virtual storage"`;
|
||||
my @out = split( '=', $out );
|
||||
|
||||
return ( xCAT::zvmUtils->trimStr( $out[2] ) );
|
||||
return ( xCAT::zvmUtils->trimStr( $out[1] ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 getCpu
|
||||
|
||||
Description : Get the processor(s) of a given node
|
||||
Arguments : User (root or non-root)
|
||||
Node
|
||||
Arguments : Node
|
||||
Returns : Processor(s)
|
||||
Example : my $proc = xCAT::zvmCPUtils->getCpu($node);
|
||||
|
||||
@@ -156,15 +129,10 @@ sub getMemory {
|
||||
sub getCpu {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $user, $node ) = @_;
|
||||
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
$sudo = "";
|
||||
}
|
||||
my ( $class, $node ) = @_;
|
||||
|
||||
# Get processors
|
||||
my $out = `ssh -o ConnectTimeout=5 $user\@$node "$sudo /sbin/vmcp q virtual cpus"`;
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q virtual cpus"`;
|
||||
my $str = xCAT::zvmUtils->tabStr($out);
|
||||
|
||||
return ($str);
|
||||
@@ -175,8 +143,7 @@ sub getCpu {
|
||||
=head3 getNic
|
||||
|
||||
Description : Get the network interface card (NIC) of a given node
|
||||
Arguments : User (root or non-root)
|
||||
Node
|
||||
Arguments : Node
|
||||
Returns : NIC(s)
|
||||
Example : my $nic = xCAT::zvmCPUtils->getNic($node);
|
||||
|
||||
@@ -186,15 +153,10 @@ sub getCpu {
|
||||
sub getNic {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $user, $node ) = @_;
|
||||
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
$sudo = "";
|
||||
}
|
||||
my ( $class, $node ) = @_;
|
||||
|
||||
# Get NIC
|
||||
my $out = `ssh -o ConnectTimeout=5 $user\@$node "$sudo /sbin/vmcp q virtual nic"`;
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q virtual nic"`;
|
||||
my $str = xCAT::zvmUtils->tabStr($out);
|
||||
|
||||
return ($str);
|
||||
@@ -205,10 +167,9 @@ sub getNic {
|
||||
=head3 getNetworkNames
|
||||
|
||||
Description : Get a list of network names available to a given node
|
||||
Arguments : User (root or non-root)
|
||||
Node
|
||||
Arguments : Node
|
||||
Returns : Network names
|
||||
Example : my $lans = xCAT::zvmCPUtils->getNetworkNames($user, $node);
|
||||
Example : my $lans = xCAT::zvmCPUtils->getNetworkNames($node);
|
||||
|
||||
=cut
|
||||
|
||||
@@ -216,15 +177,10 @@ sub getNic {
|
||||
sub getNetworkNames {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $user, $node ) = @_;
|
||||
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
$sudo = "";
|
||||
}
|
||||
my ( $class, $node ) = @_;
|
||||
|
||||
# Get network names
|
||||
my $out = `ssh -o ConnectTimeout=5 $user\@$node "$sudo /sbin/vmcp q lan | egrep 'LAN|VSWITCH'"`;
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q lan | egrep 'LAN|VSWITCH'"`;
|
||||
my @lines = split( '\n', $out );
|
||||
my @parms;
|
||||
my $names;
|
||||
@@ -257,10 +213,9 @@ sub getNetworkNames {
|
||||
=head3 getNetworkNamesArray
|
||||
|
||||
Description : Get an array of network names available to a given node
|
||||
Arguments : User (root or non-root)
|
||||
Node
|
||||
Arguments : Node
|
||||
Returns : Array of networks names
|
||||
Example : my @networks = xCAT::zvmCPUtils->getNetworkNamesArray($user, $node);
|
||||
Example : my @networks = xCAT::zvmCPUtils->getNetworkNamesArray($node);
|
||||
|
||||
=cut
|
||||
|
||||
@@ -268,17 +223,12 @@ sub getNetworkNames {
|
||||
sub getNetworkNamesArray {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $user, $node ) = @_;
|
||||
my ( $class, $node ) = @_;
|
||||
my @networks;
|
||||
my %netHash;
|
||||
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
$sudo = "";
|
||||
}
|
||||
|
||||
# Get the networks used by the node
|
||||
my $out = `ssh $user\@$node "$sudo /sbin/vmcp q v nic" | egrep -i "VSWITCH|LAN"`;
|
||||
my $out = `ssh $node "vmcp q v nic" | egrep -i "VSWITCH|LAN"`;
|
||||
my @lines = split( '\n', $out );
|
||||
|
||||
# Loop through each line
|
||||
@@ -314,8 +264,7 @@ sub getNetworkNamesArray {
|
||||
=head3 getNetwork
|
||||
|
||||
Description : Get the network info for a given node
|
||||
Arguments : User (root or non-root)
|
||||
Node
|
||||
Arguments : Node
|
||||
Network name
|
||||
Returns : Network configuration
|
||||
Example : my $config = xCAT::zvmCPUtils->getNetwork($node, $netName);
|
||||
@@ -326,19 +275,14 @@ sub getNetworkNamesArray {
|
||||
sub getNetwork {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $user, $node, $netName ) = @_;
|
||||
my ( $class, $node, $netName ) = @_;
|
||||
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
$sudo = "";
|
||||
}
|
||||
|
||||
# Get network info
|
||||
my $out;
|
||||
if ( $netName eq "all" ) {
|
||||
$out = `ssh -o ConnectTimeout=5 $user\@$node "$sudo /sbin/vmcp q lan"`;
|
||||
$out = `ssh -o ConnectTimeout=5 $node "vmcp q lan"`;
|
||||
} else {
|
||||
$out = `ssh -o ConnectTimeout=5 $user\@$node "$sudo /sbin/vmcp q lan $netName"`;
|
||||
$out = `ssh -o ConnectTimeout=5 $node "vmcp q lan $netName"`;
|
||||
}
|
||||
|
||||
return ($out);
|
||||
@@ -349,8 +293,7 @@ sub getNetwork {
|
||||
=head3 getDisks
|
||||
|
||||
Description : Get the disk(s) of given node
|
||||
Arguments : User (root or non-root)
|
||||
Node
|
||||
Arguments : Node
|
||||
Returns : Disk(s)
|
||||
Example : my $storage = xCAT::zvmCPUtils->getDisks($node);
|
||||
|
||||
@@ -360,15 +303,10 @@ sub getNetwork {
|
||||
sub getDisks {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $user, $node ) = @_;
|
||||
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
$sudo = "";
|
||||
}
|
||||
my ( $class, $node ) = @_;
|
||||
|
||||
# Get disks
|
||||
my $out = `ssh -o ConnectTimeout=5 $user\@$node "$sudo /sbin/vmcp q virtual dasd"`;
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q virtual dasd"`;
|
||||
my $str = xCAT::zvmUtils->tabStr($out);
|
||||
|
||||
return ($str);
|
||||
@@ -379,8 +317,7 @@ sub getDisks {
|
||||
=head3 loadVmcp
|
||||
|
||||
Description : Load Linux VMCP module on a given node
|
||||
Arguments : User (root or non-root)
|
||||
Node
|
||||
Arguments : Node
|
||||
Returns : Nothing
|
||||
Example : xCAT::zvmCPUtils->loadVmcp($node);
|
||||
|
||||
@@ -390,15 +327,10 @@ sub getDisks {
|
||||
sub loadVmcp {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $user, $node ) = @_;
|
||||
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
$sudo = "";
|
||||
}
|
||||
my ( $class, $node ) = @_;
|
||||
|
||||
# Load Linux VMCP module
|
||||
my $out = `ssh -o ConnectTimeout=5 $user\@$node "$sudo /sbin/modprobe vmcp"`;
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "modprobe vmcp"`;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -407,8 +339,7 @@ sub loadVmcp {
|
||||
=head3 getVswitchId
|
||||
|
||||
Description : Get the VSwitch ID(s) of given node
|
||||
Arguments : User (root or non-root)
|
||||
Node
|
||||
Arguments : Node
|
||||
Returns : VSwitch ID(s)
|
||||
Example : my @vswitch = xCAT::zvmCPUtils->getVswitchId($node);
|
||||
|
||||
@@ -418,15 +349,10 @@ sub loadVmcp {
|
||||
sub getVswitchId {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $user, $node ) = @_;
|
||||
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
$sudo = "";
|
||||
}
|
||||
my ( $class, $node ) = @_;
|
||||
|
||||
# Get VSwitch
|
||||
my $out = `ssh -o ConnectTimeout=5 $user\@$node "$sudo /sbin/vmcp q v nic" | grep "VSWITCH"`;
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q v nic" | grep "VSWITCH"`;
|
||||
my @lines = split( '\n', $out );
|
||||
my @parms;
|
||||
my @vswitch;
|
||||
@@ -443,8 +369,7 @@ sub getVswitchId {
|
||||
=head3 grantVSwitch
|
||||
|
||||
Description : Grant VSwitch access for a given userID
|
||||
Arguments : User (root or non-root)
|
||||
zHCP
|
||||
Arguments : HCP node
|
||||
User ID
|
||||
VSWITCH ID
|
||||
Returns : Operation results (Done/Failed)
|
||||
@@ -456,24 +381,15 @@ sub getVswitchId {
|
||||
sub grantVSwitch {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $callback, $user, $hcp, $userId, $vswitchId ) = @_;
|
||||
|
||||
# Directory where executables are
|
||||
my $dir = '/opt/zhcp/bin';
|
||||
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
$sudo = "";
|
||||
}
|
||||
my ( $class, $callback, $hcp, $userId, $vswitchId ) = @_;
|
||||
|
||||
# Use SMAPI EXEC
|
||||
my $out = `ssh $user\@$hcp "$sudo $dir/smcli Virtual_Network_Vswitch_Set -T SYSTEM -n $vswitchId -I $userId"`;
|
||||
xCAT::zvmUtils->printSyslog("grantVSwitch- ssh $user\@$hcp $sudo $dir/smcli Virtual_Network_Vswitch_Set -T SYSTEM -n $vswitchId -I $userId");
|
||||
# Grant VSwitch for specified userID
|
||||
my $out = `ssh $hcp "vmcp set vswitch $vswitchId grant $userId"`;
|
||||
$out = xCAT::zvmUtils->trimStr($out);
|
||||
|
||||
# If return string contains 'Done' - Operation was successful
|
||||
# If return string contains 'Command complete' - Operation was successful
|
||||
my $retStr;
|
||||
if ( $out =~ m/Done/i ) {
|
||||
if ( $out =~ m/Command complete/i ) {
|
||||
$retStr = "Done\n";
|
||||
} else {
|
||||
$retStr = "Failed\n";
|
||||
@@ -487,15 +403,12 @@ sub grantVSwitch {
|
||||
|
||||
=head3 flashCopy
|
||||
|
||||
Description : Flash copy
|
||||
Arguments : User (root or non-root)
|
||||
zHCP
|
||||
Source userId
|
||||
Description : Flash copy (Class B users only)
|
||||
Arguments : Node
|
||||
Source address
|
||||
Target userId
|
||||
Target address
|
||||
Returns : Operation results (Done/Failed)
|
||||
Example : my $results = xCAT::zvmCPUtils->flashCopy($user, $hcp, $srcAddr, $targetAddr);
|
||||
Example : my $results = xCAT::zvmCPUtils->flashCopy($node, $srcAddr, $targetAddr);
|
||||
|
||||
=cut
|
||||
|
||||
@@ -503,79 +416,19 @@ sub grantVSwitch {
|
||||
sub flashCopy {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $user, $hcp, $srcAddr, $tgtAddr ) = @_;
|
||||
|
||||
# Directory where executables are
|
||||
my $dir = '/opt/zhcp/bin';
|
||||
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
$sudo = "";
|
||||
}
|
||||
my ( $class, $node, $srcAddr, $tgtAddr ) = @_;
|
||||
|
||||
# Flash copy using CP
|
||||
my $out = `ssh $user\@$hcp "$sudo /sbin/vmcp flashcopy $srcAddr 0 end to $tgtAddr 0 end synchronous"`;
|
||||
|
||||
# Flash copy
|
||||
my $out = `ssh $node "vmcp flashcopy $srcAddr 0 end to $tgtAddr 0 end synchronous"`;
|
||||
$out = xCAT::zvmUtils->trimStr($out);
|
||||
|
||||
# If return string contains 'Command complete' - Operation was successful
|
||||
my $retStr = "";
|
||||
if ( $out =~ m/Command complete/i ) {
|
||||
$retStr = "Copying data via CP FLASHCOPY... Done\n";
|
||||
$retStr = "Done\n";
|
||||
} else {
|
||||
$out = xCAT::zvmUtils->tabStr($out);
|
||||
$retStr = "Copying data via CP FLASHCOPY... Failed\n$out";
|
||||
}
|
||||
|
||||
return $retStr;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 smapiFlashCopy
|
||||
|
||||
Description : Flash copy using SMAPI
|
||||
Arguments : User (root or non-root)
|
||||
zHCP
|
||||
Source userId
|
||||
Source address
|
||||
Target userId
|
||||
Target address
|
||||
Returns : Operation results (Done/Failed)
|
||||
Example : my $results = xCAT::zvmCPUtils->smapiFlashCopy($user, $node, $srcId, $srcAddr, $tgtId, $targetAddr);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub smapiFlashCopy {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $user, $hcp, $srcId, $srcAddr, $tgtId, $tgtAddr ) = @_;
|
||||
|
||||
# Directory where executables are
|
||||
my $dir = '/opt/zhcp/bin';
|
||||
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
$sudo = "";
|
||||
}
|
||||
|
||||
my $hcpUserId = xCAT::zvmCPUtils->getUserId($user, $hcp);
|
||||
|
||||
# Use SMAPI EXEC to flash copy
|
||||
my $cmd = '\"' . "CMD=FLASHCOPY $srcId $srcAddr 0 END $tgtId $tgtAddr 0 END" . '\"';
|
||||
my $out = `ssh $user\@$hcp "$sudo $dir/smcli xCAT_Commands_IUO -T $hcpUserId -c $cmd"`;
|
||||
xCAT::zvmUtils->printSyslog("smapiFlashCopy- ssh $user\@$hcp $sudo $dir/smcli xCAT_Commands_IUO -T $hcpUserId -c $cmd");
|
||||
|
||||
$out = xCAT::zvmUtils->trimStr($out);
|
||||
|
||||
# If return string contains 'Done' - Operation was successful
|
||||
my $retStr = "";
|
||||
if ( $out =~ m/Done/i ) {
|
||||
$retStr = "Copying data via SMAPI FLASHCOPY... Done\n";
|
||||
} else {
|
||||
$out = xCAT::zvmUtils->tabStr($out);
|
||||
$retStr = "Copying data via SMAPI FLASHCOPY... $out";
|
||||
$retStr = "Failed\n$out";
|
||||
}
|
||||
|
||||
return $retStr;
|
||||
@@ -586,8 +439,7 @@ sub smapiFlashCopy {
|
||||
=head3 punch2Reader
|
||||
|
||||
Description : Write file to z/VM punch and transfer it to reader
|
||||
Arguments : User (root or non-root)
|
||||
zHCP
|
||||
Arguments : HCP node
|
||||
UserID to receive file
|
||||
Source file
|
||||
Target file to be created by punch (e.g. sles.parm)
|
||||
@@ -599,29 +451,11 @@ sub smapiFlashCopy {
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub punch2Reader {
|
||||
my ( $class, $user, $hcp, $userId, $srcFile, $tgtFile, $options ) = @_;
|
||||
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
$sudo = "";
|
||||
}
|
||||
|
||||
# Get source node OS
|
||||
my $os = xCAT::zvmUtils->getOsVersion($user, $hcp);
|
||||
|
||||
my ( $class, $hcp, $userId, $srcFile, $tgtFile, $options ) = @_;
|
||||
|
||||
# Punch to reader
|
||||
# VMUR located in different directories on RHEL and SLES
|
||||
my $out;
|
||||
if ( $os =~ m/sles10/i ) {
|
||||
$out = `ssh -o ConnectTimeout=5 $user\@$hcp "$sudo /sbin/vmur punch $options -u $userId -r $srcFile -N $tgtFile"`;
|
||||
} elsif ( $os =~ m/sles11/i ) {
|
||||
$out = `ssh -o ConnectTimeout=5 $user\@$hcp "$sudo /usr/sbin/vmur punch $options -u $userId -r $srcFile -N $tgtFile"`;
|
||||
} elsif ( $os =~ m/rhel/i ) {
|
||||
$out = `ssh -o ConnectTimeout=5 $user\@$hcp "$sudo /usr/sbin/vmur punch $options -u $userId -r $srcFile -N $tgtFile"`;
|
||||
} else {
|
||||
$out = `ssh -o ConnectTimeout=5 $user\@$hcp "$sudo /usr/sbin/vmur punch $options -u $userId -r $srcFile -N $tgtFile"`;
|
||||
}
|
||||
|
||||
my $out = `ssh -o ConnectTimeout=5 $hcp "vmur punch $options -u $userId -r $srcFile -N $tgtFile"`;
|
||||
|
||||
# If punch is successful -- Look for this string
|
||||
my $searchStr = "created and transferred";
|
||||
if ( !( $out =~ m/$searchStr/i ) ) {
|
||||
@@ -637,9 +471,8 @@ sub punch2Reader {
|
||||
|
||||
=head3 purgeReader
|
||||
|
||||
Description : Purge reader
|
||||
Arguments : User (root or non-root)
|
||||
zHCP
|
||||
Description : Purge reader (Class D users only)
|
||||
Arguments : HCP node
|
||||
UserID to purge reader
|
||||
Returns : Nothing
|
||||
Example : my $rc = xCAT::zvmCPUtils->purgeReader($hcp, $userId);
|
||||
@@ -648,32 +481,12 @@ sub punch2Reader {
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub purgeReader {
|
||||
my ( $class, $user, $hcp, $userId ) = @_;
|
||||
|
||||
# Directory where executables are
|
||||
my $dir = '/opt/zhcp/bin';
|
||||
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
$sudo = "";
|
||||
}
|
||||
|
||||
xCAT::zvmUtils->printSyslog("sudoer:$user zHCP:$hcp sudo:$sudo");
|
||||
|
||||
my $out;
|
||||
if (xCAT::zvmUtils->smapi4xcat($user, $hcp)) {
|
||||
# Use SMAPI EXEC to purge reader
|
||||
my $cmd = '\"' . "CMD=PURGE $userId RDR ALL" . '\"';
|
||||
$out = `ssh $user\@$hcp "$sudo $dir/smcli xCAT_Commands_IUO -T $userId -c $cmd"`;
|
||||
xCAT::zvmUtils->printSyslog("smcli xCAT_Commands_IUO -T $userId -c $cmd");
|
||||
} else {
|
||||
# Purge reader using CP
|
||||
$out = `ssh -o ConnectTimeout=5 $user\@$hcp "$sudo /sbin/vmcp purge $userId rdr all"`;
|
||||
xCAT::zvmUtils->printSyslog("/sbin/vmcp purge $userId rdr all");
|
||||
}
|
||||
my ( $class, $hcp, $userId ) = @_;
|
||||
|
||||
$out = xCAT::zvmUtils->trimStr($out);
|
||||
return $out;
|
||||
# Purge reader
|
||||
my $out = `ssh -o ConnectTimeout=5 $hcp "vmcp purge $userId rdr all"`;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
@@ -681,8 +494,7 @@ sub purgeReader {
|
||||
=head3 sendCPCmd
|
||||
|
||||
Description : Send CP command to a given userID (Class C users only)
|
||||
Arguments : User (root or non-root)
|
||||
zHCP
|
||||
Arguments : HCP node
|
||||
UserID to send CP command
|
||||
Returns : Nothing
|
||||
Example : xCAT::zvmCPUtils->sendCPCmd($hcp, $userId, $cmd);
|
||||
@@ -691,31 +503,11 @@ sub purgeReader {
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub sendCPCmd {
|
||||
my ( $class, $user, $hcp, $userId, $cmd ) = @_;
|
||||
my ( $class, $hcp, $userId, $cmd ) = @_;
|
||||
|
||||
# Directory where executables are
|
||||
my $dir = '/opt/zhcp/bin';
|
||||
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
$sudo = "";
|
||||
}
|
||||
|
||||
xCAT::zvmUtils->printSyslog("sudoer:$user zHCP:$hcp sudo:$sudo");
|
||||
|
||||
my $out;
|
||||
if (xCAT::zvmUtils->smapi4xcat($user, $hcp)) {
|
||||
# Use SMAPI EXEC to send command
|
||||
$cmd = '\"' . "CMD=SEND CP $userId " . uc($cmd) . '\"';
|
||||
$out = `ssh $user\@$hcp "$sudo $dir/smcli xCAT_Commands_IUO -T $userId -c $cmd"`;
|
||||
xCAT::zvmUtils->printSyslog("smcli xCAT_Commands_IUO -T $userId -c $cmd");
|
||||
} else {
|
||||
# Send CP command to given user
|
||||
$out = `ssh $user\@$hcp "$sudo /sbin/vmcp send cp $userId $cmd"`;
|
||||
xCAT::zvmUtils->printSyslog("/sbin/vmcp send cp $userId $cmd");
|
||||
}
|
||||
# Send CP command to given userID
|
||||
my $out = `ssh $hcp "vmcp send cp $userId $cmd"`;
|
||||
|
||||
$out = xCAT::zvmUtils->trimStr($out);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -724,8 +516,7 @@ sub sendCPCmd {
|
||||
=head3 getNetworkLayer
|
||||
|
||||
Description : Get the network layer for a given node
|
||||
Arguments : User (root or non-root)
|
||||
Node
|
||||
Arguments : Node
|
||||
Network name
|
||||
Returns : 2 - Layer 2
|
||||
3 - Layer 3
|
||||
@@ -736,20 +527,15 @@ sub sendCPCmd {
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub getNetworkLayer {
|
||||
my ( $class, $user, $node, $netName ) = @_;
|
||||
my ( $class, $node, $netName ) = @_;
|
||||
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
$sudo = "";
|
||||
}
|
||||
|
||||
# Exit if the network name is not given
|
||||
if ( !$netName ) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
# Get network type (Layer 2 or 3)
|
||||
my $out = `ssh -o ConnectTimeout=5 $user\@$node "$sudo /sbin/vmcp q lan $netName"`;
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q lan $netName"`;
|
||||
if ( !$out ) {
|
||||
return -1;
|
||||
}
|
||||
@@ -773,8 +559,7 @@ sub getNetworkLayer {
|
||||
=head3 getNetworkType
|
||||
|
||||
Description : Get the network type of a given network
|
||||
Arguments : User (root or non-root)
|
||||
zHCP
|
||||
Arguments : HCP node
|
||||
Name of network
|
||||
Returns : Network type (VSWITCH/HIPERS/QDIO)
|
||||
Example : my $netType = xCAT::zvmCPUtils->getNetworkType($hcp, $netName);
|
||||
@@ -783,15 +568,10 @@ sub getNetworkLayer {
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub getNetworkType {
|
||||
my ( $class, $user, $hcp, $netName ) = @_;
|
||||
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
$sudo = "";
|
||||
}
|
||||
|
||||
my ( $class, $hcp, $netName ) = @_;
|
||||
|
||||
# Get network details
|
||||
my $out = `ssh -o ConnectTimeout=5 $user\@$hcp "$sudo /sbin/vmcp q lan $netName" | grep "Type"`;
|
||||
my $out = `ssh -o ConnectTimeout=5 $hcp "vmcp q lan $netName" | grep "Type"`;
|
||||
|
||||
# Go through each line and determine network type
|
||||
my @lines = split( '\n', $out );
|
||||
@@ -822,8 +602,7 @@ sub getNetworkType {
|
||||
=head3 defineCpu
|
||||
|
||||
Description : Add processor(s) to given node
|
||||
Arguments : User (root or non-root)
|
||||
Node
|
||||
Arguments : Node
|
||||
Returns : Nothing
|
||||
Example : my $out = xCAT::zvmCPUtils->defineCpu($node, $addr, $type);
|
||||
|
||||
@@ -833,15 +612,10 @@ sub getNetworkType {
|
||||
sub defineCpu {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $user, $node, $addr, $type ) = @_;
|
||||
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
$sudo = "";
|
||||
}
|
||||
my ( $class, $node, $addr, $type ) = @_;
|
||||
|
||||
# Define processor(s)
|
||||
my $out = `ssh -o ConnectTimeout=5 $user\@$node "$sudo /sbin/vmcp define cpu $addr type $type"`;
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp define cpu $addr type $type"`;
|
||||
|
||||
return ($out);
|
||||
}
|
||||
|
||||
+134
-1830
File diff suppressed because it is too large
Load Diff
@@ -1,5 +0,0 @@
|
||||
xcat-ibmhpc (2.8.0-1) stable; urgency=low
|
||||
|
||||
* Initial Release
|
||||
|
||||
-- OCF xCAT <xcat@ocf.co.uk> Tue, 03 Apr 2012 09:00:00 -0000
|
||||
@@ -1 +0,0 @@
|
||||
5
|
||||
@@ -1,15 +0,0 @@
|
||||
Source: xcat-ibmhpc
|
||||
Section: admin
|
||||
Priority: extra
|
||||
Maintainer: Arif Ali <aali@ocf.co.uk>
|
||||
Build-Depends: debhelper (>= 5)
|
||||
Standards-Version: 3.7.2
|
||||
|
||||
Package: xcat-ibmhpc
|
||||
Architecture: all
|
||||
Depends: ${perl:Depends}, perl-xcat (>= 2.8.0), xcat-client (>= 2.8.0)
|
||||
Description: Install and configuration utilities for IBM HPC products in an xCAT cluster
|
||||
xCAT-IBMhpc provides sample installation and configuration scripts for running
|
||||
the IBM HPC software stack in an xCAT cluser. Support for the following IBM
|
||||
products is provided: GPFS, LoadLeveler, Parallel Environment, ESSL and Parallel
|
||||
ESSL libraries, some compilers (vac, xlC, xlf).
|
||||
@@ -1,88 +0,0 @@
|
||||
Eclipse Public License - v 1.0
|
||||
|
||||
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
|
||||
1. DEFINITIONS
|
||||
|
||||
"Contribution" means:
|
||||
|
||||
a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
|
||||
b) in the case of each subsequent Contributor:
|
||||
|
||||
i) changes to the Program, and
|
||||
|
||||
ii) additions to the Program;
|
||||
|
||||
where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
|
||||
|
||||
"Contributor" means any person or entity that distributes the Program.
|
||||
|
||||
"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
|
||||
|
||||
"Program" means the Contributions distributed in accordance with this Agreement.
|
||||
|
||||
"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
|
||||
|
||||
2. GRANT OF RIGHTS
|
||||
|
||||
a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
|
||||
|
||||
b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
|
||||
|
||||
c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
|
||||
|
||||
d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
|
||||
|
||||
3. REQUIREMENTS
|
||||
|
||||
A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
|
||||
|
||||
a) it complies with the terms and conditions of this Agreement; and
|
||||
|
||||
b) its license agreement:
|
||||
|
||||
i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
|
||||
|
||||
ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
|
||||
|
||||
iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
|
||||
|
||||
iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
|
||||
|
||||
When the Program is made available in source code form:
|
||||
|
||||
a) it must be made available under this Agreement; and
|
||||
|
||||
b) a copy of this Agreement must be included with each copy of the Program.
|
||||
|
||||
Contributors may not remove or alter any copyright notices contained within the Program.
|
||||
|
||||
Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
|
||||
|
||||
4. COMMERCIAL DISTRIBUTION
|
||||
|
||||
Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
|
||||
|
||||
For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
|
||||
|
||||
5. NO WARRANTY
|
||||
|
||||
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
|
||||
|
||||
6. DISCLAIMER OF LIABILITY
|
||||
|
||||
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
7. GENERAL
|
||||
|
||||
If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
|
||||
|
||||
If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
|
||||
|
||||
All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
|
||||
|
||||
Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
|
||||
|
||||
This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
opt/xcat/share/xcat/IBMhpc/compilers
|
||||
opt/xcat/share/xcat/IBMhpc/essl
|
||||
opt/xcat/share/xcat/IBMhpc/gpfs
|
||||
opt/xcat/share/xcat/IBMhpc/loadl
|
||||
opt/xcat/share/xcat/IBMhpc/pe
|
||||
opt/xcat/share/xcat/IBMhpc/rsct
|
||||
opt/xcat/share/xcat/IBMhpc/compilers
|
||||
opt/xcat/share/doc/packages/xCAT-IBMhpc
|
||||
@@ -1 +0,0 @@
|
||||
LICENSE.html
|
||||
@@ -1,2 +0,0 @@
|
||||
share/xcat/IBMhpc/* opt/xcat/share/xcat/IBMhpc/
|
||||
LICENSE.html share/doc/packages/xCAT-IBMhpc/
|
||||
@@ -1,70 +0,0 @@
|
||||
#!/usr/bin/make -f
|
||||
# -*- makefile -*-
|
||||
# Sample debian/rules that uses debhelper.
|
||||
# This file was originally written by Joey Hess and Craig Small.
|
||||
# As a special exception, when this file is copied by dh-make into a
|
||||
# dh-make output file, you may use that output file without restriction.
|
||||
# This special exception was added by Craig Small in version 0.37 of dh-make.
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
export DH_COMPAT=5
|
||||
|
||||
|
||||
build:
|
||||
pwd
|
||||
dh_quilt_patch
|
||||
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_clean -d
|
||||
|
||||
install:
|
||||
pwd
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_installdirs
|
||||
dh_install -X".svn"
|
||||
dh_link
|
||||
|
||||
|
||||
# Build architecture-independent files here.
|
||||
binary-indep: build install
|
||||
# We have nothing to do by default.
|
||||
|
||||
# Build architecture-dependent files here.
|
||||
binary-arch:
|
||||
pwd
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_installchangelogs
|
||||
dh_installdocs
|
||||
# dh_installexamples
|
||||
dh_install -X".svn"
|
||||
# dh_installmenu
|
||||
# dh_installdebconf
|
||||
# dh_installlogrotate
|
||||
# dh_installemacsen
|
||||
# dh_installpam
|
||||
# dh_installmime
|
||||
# dh_python
|
||||
# dh_installinit
|
||||
# dh_installcron
|
||||
# dh_installinfo
|
||||
dh_installman
|
||||
# dh_link
|
||||
# dh_strip
|
||||
dh_compress
|
||||
# dh_fixperms
|
||||
dh_perl
|
||||
dh_makeshlibs
|
||||
dh_installdeb
|
||||
dh_shlibdeps
|
||||
dh_gencontrol
|
||||
dh_md5sums
|
||||
dh_builddeb
|
||||
|
||||
binary: binary-indep binary-arch
|
||||
.PHONY: build clean binary-indep binary-arch binary install configure
|
||||
@@ -1 +0,0 @@
|
||||
1.0
|
||||
@@ -1,7 +0,0 @@
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/IBMhpc.rhels6.ppc64.exlist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/gpfs/gpfs.exlist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/compilers/compilers.exlist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/pe/pe.exlist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/essl/essl.exlist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/rsct/rsct.exlist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/loadl/loadl.exlist#
|
||||
@@ -1,5 +0,0 @@
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/gpfs/gpfs.otherpkgs.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/compilers/compilers.otherpkgs.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/pe/pe-1200.rhels6.ppc64.otherpkgs.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/essl/essl.otherpkgs.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/loadl/loadl-5103.otherpkgs.pkglist#
|
||||
@@ -1,4 +0,0 @@
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/IBMhpc.rhels6.ppc64.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/pe/pe-1200.rhels6.ppc64.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/compilers/compilers.rhels6.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/essl/essl.pkglist#
|
||||
@@ -1,62 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Sample postinstall script for building a diskless SLES11 PPC64 image
|
||||
# with all IBM HPC products
|
||||
#
|
||||
#-- this script is run after all packages from $profile.pkglist are installed
|
||||
#--
|
||||
#-- it gets these arguments:
|
||||
#--
|
||||
#-- $1 = install root (chroot directory for profile)
|
||||
#-- $2 = OS version
|
||||
#-- $3 = architecture
|
||||
#-- $4 = profile name
|
||||
#-- $5 = work dir (where genimage is located)
|
||||
#--
|
||||
#--
|
||||
installroot=$1
|
||||
osver=$2
|
||||
arch=$3
|
||||
profile=$4
|
||||
workdir=$5
|
||||
|
||||
otherpkgs=/install/post/otherpkgs/$osver/$arch
|
||||
|
||||
################
|
||||
# This script runs other postinstall scripts from the $hpc directory
|
||||
# If you have created a custom copy of ANY of these scripts,
|
||||
# make sure to change the execution path from $hpc/<product> to the location
|
||||
# you have placed your script in
|
||||
###############
|
||||
hpc=/opt/xcat/share/xcat/IBMhpc
|
||||
custom=/install/custom/netboot/rh
|
||||
installps=/install/postscripts
|
||||
|
||||
# Run default postinstall shipped with xcat
|
||||
/opt/xcat/share/xcat/netboot/rh/compute.rhels6.ppc64.postinstall $1 $2 $3 $4 $5
|
||||
|
||||
|
||||
# Run general IBMhpc postinstall script
|
||||
$hpc/IBMhpc.rhel.postinstall $1 $2 $3 $4 $5
|
||||
|
||||
|
||||
# Run script to install gpfs updates
|
||||
installroot=$installroot NODESETSTATE=genimage $hpc/gpfs/gpfs_updates
|
||||
# Run script to update GPFS mmsdrfs file in the image
|
||||
installroot=$installroot $hpc/gpfs/gpfs_mmsdrfs
|
||||
|
||||
|
||||
# Run script to accept compiler license
|
||||
installroot=$installroot NODESETSTATE=genimage $hpc/compilers/compilers_license
|
||||
|
||||
|
||||
# Run script to install PE and accept license
|
||||
installroot=$installroot pedir=$otherpkgs/pe NODESETSTATE=genimage $hpc/pe/pe_install-1200
|
||||
|
||||
# Run script to accept LoadLeveler license, install product rpms,
|
||||
# and do some config
|
||||
installroot=$installroot loadldir=$otherpkgs/loadl NODESETSTATE=genimage $hpc/loadl/loadl_install-5103
|
||||
|
||||
# Run script to install RSCT rpms
|
||||
installroot=$installroot rsctdir=$otherpkgs/rsct NODESETSTATE=genimage $hpc/rsct/rsct_install
|
||||
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/IBMhpc.rhels6.x86_64.exlist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/gpfs/gpfs.exlist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/pe/pe.exlist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/compilers/compilers.exlist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/essl/essl.exlist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/rsct/rsct.exlist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/loadl/loadl.exlist#
|
||||
@@ -1,3 +0,0 @@
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/gpfs/gpfs.x86_64.otherpkgs.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/pe/pe-1200.rhels6.x86_64.otherpkgs.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/loadl/loadl-5103.otherpkgs.pkglist#
|
||||
@@ -1,4 +0,0 @@
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/IBMhpc.rhels6.x86_64.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/pe/pe-1200.rhels6.x86_64.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/compilers/compilers.rhels6.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/essl/essl.pkglist#
|
||||
@@ -1,60 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Sample postinstall script for building a diskless SLES11 PPC64 image
|
||||
# with all IBM HPC products
|
||||
#
|
||||
#-- this script is run after all packages from $profile.pkglist are installed
|
||||
#--
|
||||
#-- it gets these arguments:
|
||||
#--
|
||||
#-- $1 = install root (chroot directory for profile)
|
||||
#-- $2 = OS version
|
||||
#-- $3 = architecture
|
||||
#-- $4 = profile name
|
||||
#-- $5 = work dir (where genimage is located)
|
||||
#--
|
||||
#--
|
||||
installroot=$1
|
||||
osver=$2
|
||||
arch=$3
|
||||
profile=$4
|
||||
workdir=$5
|
||||
|
||||
otherpkgs=/install/post/otherpkgs/$osver/$arch
|
||||
|
||||
################
|
||||
# This script runs other postinstall scripts from the $hpc directory
|
||||
# If you have created a custom copy of ANY of these scripts,
|
||||
# make sure to change the execution path from $hpc/<product> to the location
|
||||
# you have placed your script in
|
||||
###############
|
||||
hpc=/opt/xcat/share/xcat/IBMhpc
|
||||
custom=/install/custom/netboot/rh
|
||||
installps=/install/postscripts
|
||||
|
||||
# Run default postinstall shipped with xcat
|
||||
/opt/xcat/share/xcat/netboot/rh/compute.rhels6.x86_64.postinstall $1 $2 $3 $4 $5
|
||||
|
||||
|
||||
# Run general IBMhpc postinstall script
|
||||
$hpc/IBMhpc.rhel.postinstall $1 $2 $3 $4 $5
|
||||
|
||||
|
||||
# Run script to install gpfs updates
|
||||
installroot=$installroot NODESETSTATE=genimage $hpc/gpfs/gpfs_updates
|
||||
# Run script to update GPFS mmsdrfs file in the image
|
||||
installroot=$installroot $hpc/gpfs/gpfs_mmsdrfs
|
||||
|
||||
|
||||
# Run script to accept compiler license. x86_64 is using gcc, comment this line.
|
||||
#installroot=$installroot NODESETSTATE=genimage $hpc/compilers/compilers_license
|
||||
|
||||
|
||||
# Run script to install PE and accept license
|
||||
installroot=$installroot pedir=$otherpkgs/pe NODESETSTATE=genimage $hpc/pe/pe_install-1200
|
||||
|
||||
# Run script to accept LoadLeveler license, install product rpms,
|
||||
# and do some config
|
||||
installroot=$installroot loadldir=$otherpkgs/loadl NODESETSTATE=genimage $hpc/loadl/loadl_install-5103
|
||||
|
||||
# Run script to install RSCT rpms. Not available on x86_64
|
||||
#installroot=$installroot rsctdir=$otherpkgs/rsct NODESETSTATE=genimage $hpc/rsct/rsct_install
|
||||
@@ -1,10 +0,0 @@
|
||||
# Sample exlude list for building a diskless SLES 11 PPC64 image
|
||||
|
||||
#INCLUDE:/opt/xcat/share/xcat/netboot/sles/compute.exlist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/IBMhpc.sles11.ppc64.exlist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/compilers/compilers.exlist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/essl/essl.exlist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/gpfs/gpfs.exlist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/loadl/loadl.exlist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/pe/pe.exlist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/rsct/rsct.exlist#
|
||||
@@ -1,13 +0,0 @@
|
||||
# Sample otherpkgs pkglist for installing all IBM HPC products in a
|
||||
# SLES11 PPC64 diskless image
|
||||
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/compilers/compilers.otherpkgs.pkglist#
|
||||
#NEW_INSTALL_LIST#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/gpfs/gpfs.otherpkgs.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/pe/pe.otherpkgs.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/essl/essl.otherpkgs.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/loadl/loadl-5103.otherpkgs.pkglist#
|
||||
|
||||
# For full-disk (stateful) images, EDIT below to use rsct.otherpkgs
|
||||
# For diskless, rpms are installed with postinstall script
|
||||
#do not INCLUDE:/opt/xcat/share/xcat/IBMhpc/rsct/rsct.otherpkgs.pkglist#
|
||||
@@ -1,10 +0,0 @@
|
||||
# Sample package list for installing all IBM HPC products in a
|
||||
# SLES11 ppc64 diskless image
|
||||
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/IBMhpc.sles11.ppc64.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/compilers/compilers.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/essl/essl.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/pe/pe-1200.sles11.ppc64.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/rsct/rsct.pkglist#
|
||||
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Sample postinstall script for building a diskless SLES11 PPC64 image
|
||||
# with all IBM HPC products
|
||||
#
|
||||
#-- this script is run after all packages from $profile.pkglist are installed
|
||||
#--
|
||||
#-- it gets these arguments:
|
||||
#--
|
||||
#-- $1 = install root (chroot directory for profile)
|
||||
#-- $2 = OS version
|
||||
#-- $3 = architecture
|
||||
#-- $4 = profile name
|
||||
#-- $5 = work dir (where genimage is located)
|
||||
#--
|
||||
#--
|
||||
installroot=$1
|
||||
osver=$2
|
||||
arch=$3
|
||||
profile=$4
|
||||
workdir=$5
|
||||
|
||||
otherpkgs=/install/post/otherpkgs/$osver/$arch
|
||||
|
||||
################
|
||||
# This script runs other postinstall scripts from the $hpc directory
|
||||
# If you have created a custom copy of ANY of these scripts,
|
||||
# make sure to change the execution path from $hpc/<product> to the location
|
||||
# you have placed your script in
|
||||
###############
|
||||
hpc=/opt/xcat/share/xcat/IBMhpc
|
||||
custom=/install/custom/netboot/sles
|
||||
installps=/install/postscripts
|
||||
|
||||
|
||||
# Run default postinstall shipped with xcat
|
||||
/opt/xcat/share/xcat/netboot/sles/compute.sles11.postinstall $1 $2 $3 $4 $5
|
||||
|
||||
|
||||
# Run general IBMhpc postinstall script
|
||||
$hpc/IBMhpc.sles.postinstall $1 $2 $3 $4 $5
|
||||
|
||||
|
||||
# Run script to install gpfs updates
|
||||
installroot=$installroot NODESETSTATE=genimage $hpc/gpfs/gpfs_updates
|
||||
# Run script to update GPFS mmsdrfs file in the image
|
||||
installroot=$installroot $hpc/gpfs/gpfs_mmsdrfs
|
||||
|
||||
|
||||
# Run script to accept compiler license
|
||||
installroot=$installroot NODESETSTATE=genimage $hpc/compilers/compilers_license
|
||||
|
||||
|
||||
# Run script to install PE and accept license
|
||||
installroot=$installroot pedir=$otherpkgs/pe NODESETSTATE=genimage $hpc/pe/pe_install
|
||||
|
||||
|
||||
# Run script to install ESSL and PESSL rpms
|
||||
#installroot=$installroot essldir=$otherpkgs/essl NODESETSTATE=genimage $hpc/essl/essl_install
|
||||
|
||||
|
||||
# Run script to accept LoadLeveler license, install product rpms,
|
||||
# and do some config
|
||||
installroot=$installroot loadldir=$otherpkgs/loadl NODESETSTATE=genimage $hpc/loadl/loadl_install-5103
|
||||
|
||||
# Run script to install RSCT rpms
|
||||
installroot=$installroot rsctdir=$otherpkgs/rsct NODESETSTATE=genimage $hpc/rsct/rsct_install
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/IBMhpc.sles11.x86_64.exlist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/gpfs/gpfs.exlist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/pe/pe.exlist#
|
||||
@@ -1,3 +0,0 @@
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/gpfs/gpfs.x86_64.otherpkgs.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/pe/pe-1200.sles11.x86_64.otherpkgs.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/loadl/loadl-5103.otherpkgs.pkglist#
|
||||
@@ -1,2 +0,0 @@
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/IBMhpc.sles11.x86_64.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/pe/pe-1200.sles11.x86_64.pkglist#
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user