| 1 |
import unittest |
| 2 |
import nose2 |
| 3 |
import os |
| 4 |
|
| 5 |
from ncclient.manager import Manager, make_device_handler |
| 6 |
from ncclient.transport import SSHSession |
| 7 |
|
| 8 |
from jnpr.junos import Device |
| 9 |
from jnpr.junos.utils.fs import FS |
| 10 |
from jnpr.junos.exception import RpcError |
| 11 |
|
| 12 |
from unittest.mock import patch, MagicMock, call |
| 13 |
from lxml import etree |
| 14 |
|
| 15 |
__author__ = "Nitin Kumar, Rick Sherman" |
| 16 |
__credits__ = "Jeremy Schulman" |
| 17 |
|
| 18 |
|
| 19 |
class TestFS(unittest.TestCase): |
| 20 |
@patch("ncclient.manager.connect") |
| 21 |
def setUp(self, mock_connect): |
| 22 |
mock_connect.side_effect = self._mock_manager |
| 23 |
self.dev = Device( |
| 24 |
host="1.1.1.1", user="rick", password="password123", gather_facts=False |
| 25 |
) |
| 26 |
self.dev.open() |
| 27 |
self.fs = FS(self.dev) |
| 28 |
|
| 29 |
@patch("jnpr.junos.device.warnings") |
| 30 |
def test_cat_wrong_path_return_none(self, mock_warnings): |
| 31 |
path = "test/report" |
| 32 |
self.assertEqual(self.fs.cat(path), None) |
| 33 |
|
| 34 |
def test_cat(self): |
| 35 |
self.fs._dev.rpc.file_show = MagicMock(side_effect=self._mock_manager) |
| 36 |
path = "test/cat.txt" |
| 37 |
self.assertTrue("testing cat functionality" in self.fs.cat(path)) |
| 38 |
self.fs._dev.rpc.file_show.assert_called_with(filename="test/cat.txt") |
| 39 |
|
| 40 |
def test_cwd(self): |
| 41 |
self.fs._dev.rpc.set_cli_working_directory = MagicMock( |
| 42 |
side_effect=self._mock_manager |
| 43 |
) |
| 44 |
folder = "change/directory" |
| 45 |
self.assertEqual("change/directory", self.fs.cwd(folder)) |
| 46 |
self.fs._dev.rpc.set_cli_working_directory.assert_called_with( |
| 47 |
directory="change/directory" |
| 48 |
) |
| 49 |
|
| 50 |
@patch("jnpr.junos.Device.execute") |
| 51 |
def test_pwd(self, mock_execute): |
| 52 |
mock_execute.side_effect = MagicMock(side_effect=self._mock_manager) |
| 53 |
self.fs.pwd() |
| 54 |
self.assertEqual(self.fs.pwd(), "/cf/var/home/rick") |
| 55 |
|
| 56 |
@patch("jnpr.junos.device.warnings") |
| 57 |
def test_checksum_return_none(self, mock_warnings): |
| 58 |
path = "test/report" |
| 59 |
self.assertEqual(self.fs.checksum(path), None) |
| 60 |
|
| 61 |
def test_checksum_unknown_calc(self): |
| 62 |
path = "test/report" |
| 63 |
self.assertRaises(ValueError, self.fs.checksum, path=path, calc="abc") |
| 64 |
|
| 65 |
def test_checksum_return_rsp(self): |
| 66 |
self.fs.dev.rpc.get_sha256_checksum_information = MagicMock( |
| 67 |
side_effect=self._mock_manager |
| 68 |
) |
| 69 |
path = "test/checksum" |
| 70 |
self.assertEqual(self.fs.checksum(path, "sha256"), "xxxx") |
| 71 |
self.fs.dev.rpc.get_sha256_checksum_information.assert_called_with( |
| 72 |
path="test/checksum" |
| 73 |
) |
| 74 |
|
| 75 |
def test_stat_calling___decode_file(self): |
| 76 |
path = "test/stat/decode_file" |
| 77 |
self.fs.dev.rpc.file_list = MagicMock(side_effect=self._mock_manager) |
| 78 |
self.assertEqual( |
| 79 |
self.fs.stat(path), |
| 80 |
{ |
| 81 |
"owner": "pqr", |
| 82 |
"path": "/var/abc.sh", |
| 83 |
"permissions": 755, |
| 84 |
"permissions_text": "-rwxr-xr-x", |
| 85 |
"size": 2, |
| 86 |
"ts_date": "Mar 13 06:54", |
| 87 |
"ts_epoc": "1394693680", |
| 88 |
"type": "file", |
| 89 |
}, |
| 90 |
) |
| 91 |
|
| 92 |
def test_stat_calling___decode_dir(self): |
| 93 |
path = "test/stat/decode_dir" |
| 94 |
self.fs.dev.rpc.file_list = MagicMock(side_effect=self._mock_manager) |
| 95 |
self.assertEqual( |
| 96 |
self.fs.stat(path), |
| 97 |
{"path": "/var", "type": "dir", "file_count": 1, "size": 2}, |
| 98 |
) |
| 99 |
|
| 100 |
def test_stat_return_none(self): |
| 101 |
path = "test/abc" |
| 102 |
self.fs.dev.rpc.file_list = MagicMock() |
| 103 |
self.fs.dev.rpc.file_list.find.return_value = "output" |
| 104 |
self.assertEqual(self.fs.stat(path), None) |
| 105 |
|
| 106 |
def test_ls_calling___decode_file(self): |
| 107 |
path = "test/stat/decode_file" |
| 108 |
self.fs.dev.rpc.file_list = MagicMock(side_effect=self._mock_manager) |
| 109 |
self.assertEqual( |
| 110 |
self.fs.ls(path), |
| 111 |
{ |
| 112 |
"owner": "pqr", |
| 113 |
"path": "/var/abc.sh", |
| 114 |
"permissions": 755, |
| 115 |
"permissions_text": "-rwxr-xr-x", |
| 116 |
"size": 2, |
| 117 |
"ts_date": "Mar 13 06:54", |
| 118 |
"ts_epoc": "1394693680", |
| 119 |
"type": "file", |
| 120 |
}, |
| 121 |
) |
| 122 |
|
| 123 |
def test_ls_calling___decode_dir(self): |
| 124 |
path = "test/stat/decode_dir" |
| 125 |
self.fs.dev.rpc.file_list = MagicMock(side_effect=self._mock_manager) |
| 126 |
self.assertEqual( |
| 127 |
self.fs.ls(path), |
| 128 |
{ |
| 129 |
"files": { |
| 130 |
"abc": { |
| 131 |
"permissions_text": "drwxr-xr-x", |
| 132 |
"ts_date": "Feb 17 15:30", |
| 133 |
"ts_epoc": "1392651039", |
| 134 |
"owner": "root", |
| 135 |
"path": "abc", |
| 136 |
"size": 2, |
| 137 |
"type": "dir", |
| 138 |
"permissions": 555, |
| 139 |
} |
| 140 |
}, |
| 141 |
"path": "/var", |
| 142 |
"type": "dir", |
| 143 |
"file_count": 1, |
| 144 |
"size": 2, |
| 145 |
}, |
| 146 |
) |
| 147 |
|
| 148 |
def test_ls_return_none(self): |
| 149 |
path = "test/abc" |
| 150 |
self.fs.dev.rpc.file_list = MagicMock() |
| 151 |
self.fs.dev.rpc.file_list.find.return_value = "output" |
| 152 |
self.assertEqual(self.fs.ls(path), None) |
| 153 |
|
| 154 |
@patch("jnpr.junos.utils.fs.FS._decode_file") |
| 155 |
def test_ls_link_path_false(self, mock_decode_file): |
| 156 |
mock_decode_file.get.return_value = False |
| 157 |
path = "test/stat/decode_file" |
| 158 |
self.fs.dev.rpc.file_list = MagicMock(side_effect=self._mock_manager) |
| 159 |
self.fs.ls(path, followlink=False) |
| 160 |
mock_decode_file.assert_has_calls([call().get("link")]) |
| 161 |
|
| 162 |
def test_ls_brief_true(self): |
| 163 |
path = "test/stat/decode_dir" |
| 164 |
self.fs.dev.rpc.file_list = MagicMock(side_effect=self._mock_manager) |
| 165 |
self.assertEqual( |
| 166 |
self.fs.ls(path, brief=True), |
| 167 |
{ |
| 168 |
"files": ["abc"], |
| 169 |
"path": "/var", |
| 170 |
"type": "dir", |
| 171 |
"file_count": 1, |
| 172 |
"size": 2, |
| 173 |
}, |
| 174 |
) |
| 175 |
|
| 176 |
def test_ls_calling___decode_dir_type_symbolic_link(self): |
| 177 |
path = "test/stat/decode_symbolic_link" |
| 178 |
self.fs.dev.rpc.file_list = MagicMock(side_effect=self._mock_manager) |
| 179 |
self.assertEqual( |
| 180 |
self.fs.ls(path), |
| 181 |
{ |
| 182 |
"files": { |
| 183 |
"abc": { |
| 184 |
"permissions_text": "drwxr-xr-x", |
| 185 |
"ts_date": "Feb 17 15:30", |
| 186 |
"link": "symlink test", |
| 187 |
"ts_epoc": "1392651039", |
| 188 |
"owner": "root", |
| 189 |
"path": "abc", |
| 190 |
"size": 2, |
| 191 |
"type": "link", |
| 192 |
"permissions": 555, |
| 193 |
} |
| 194 |
}, |
| 195 |
"path": "/var", |
| 196 |
"type": "dir", |
| 197 |
"file_count": 1, |
| 198 |
"size": 2, |
| 199 |
}, |
| 200 |
) |
| 201 |
|
| 202 |
def test_rm_return_true(self): |
| 203 |
self.fs.dev.rpc.file_delete = MagicMock(return_value=True) |
| 204 |
path = "test/abc" |
| 205 |
self.assertTrue(self.fs.rm(path)) |
| 206 |
self.fs.dev.rpc.file_delete.assert_called_once_with(path="test/abc") |
| 207 |
|
| 208 |
def test_rm_return_false(self): |
| 209 |
path = "test/abc" |
| 210 |
self.fs.dev.rpc.file_delete = MagicMock(return_value=False) |
| 211 |
self.assertFalse(self.fs.rm(path)) |
| 212 |
self.fs.dev.rpc.file_delete.assert_called_once_with(path="test/abc") |
| 213 |
|
| 214 |
def test_copy_return_true(self): |
| 215 |
self.fs.dev.rpc.file_copy = MagicMock() |
| 216 |
initial = "test/abc" |
| 217 |
final = "test/xyz" |
| 218 |
self.assertTrue(self.fs.cp(initial, final)) |
| 219 |
self.fs.dev.rpc.file_copy.assert_called_once_with( |
| 220 |
source="test/abc", destination="test/xyz" |
| 221 |
) |
| 222 |
|
| 223 |
def test_copy_routing_instance_return_true(self): |
| 224 |
self.fs.dev.rpc.file_copy = MagicMock() |
| 225 |
initial = "test/abc" |
| 226 |
final = "test/xyz" |
| 227 |
ri_name = "test_ri" |
| 228 |
self.assertTrue(self.fs.cp(initial, final, routing_instance=ri_name)) |
| 229 |
self.fs.dev.rpc.file_copy.assert_called_once_with( |
| 230 |
source="test/abc", destination="test/xyz", routing_instance="test_ri" |
| 231 |
) |
| 232 |
|
| 233 |
def test_copy_source_address_return_true(self): |
| 234 |
self.fs.dev.rpc.file_copy = MagicMock() |
| 235 |
initial = "test/abc" |
| 236 |
final = "test/xyz" |
| 237 |
s_add = "0.0.0.0" |
| 238 |
self.assertTrue(self.fs.cp(initial, final, source_address=s_add)) |
| 239 |
self.fs.dev.rpc.file_copy.assert_called_once_with( |
| 240 |
source="test/abc", destination="test/xyz", source_address="0.0.0.0" |
| 241 |
) |
| 242 |
|
| 243 |
def test_copy_return_false(self): |
| 244 |
initial = "test/abc" |
| 245 |
final = "test/xyz" |
| 246 |
self.fs.dev.rpc.file_copy = MagicMock(side_effect=Exception) |
| 247 |
self.assertFalse(self.fs.cp(initial, final)) |
| 248 |
self.fs.dev.rpc.file_copy.assert_called_once_with( |
| 249 |
source="test/abc", destination="test/xyz" |
| 250 |
) |
| 251 |
|
| 252 |
def test_move_return_true(self): |
| 253 |
self.fs.dev.rpc.file_rename = MagicMock(return_value=True) |
| 254 |
initial = "test/abc" |
| 255 |
final = "test/xyz" |
| 256 |
self.assertTrue(self.fs.mv(initial, final)) |
| 257 |
self.fs.dev.rpc.file_rename.assert_called_once_with( |
| 258 |
source="test/abc", destination="test/xyz" |
| 259 |
) |
| 260 |
|
| 261 |
def test_move_return_false(self): |
| 262 |
initial = "test/abc" |
| 263 |
final = "test/xyz" |
| 264 |
self.fs.dev.rpc.file_rename = MagicMock(return_value=False) |
| 265 |
self.assertFalse(self.fs.mv(initial, final)) |
| 266 |
self.fs.dev.rpc.file_rename.assert_called_once_with( |
| 267 |
source="test/abc", destination="test/xyz" |
| 268 |
) |
| 269 |
|
| 270 |
def test_tgz_return_true(self): |
| 271 |
src = "test/tgz.txt" |
| 272 |
dst = "test/xyz" |
| 273 |
self.fs.dev.rpc.file_archive = MagicMock(return_value=True) |
| 274 |
self.assertTrue(self.fs.tgz(src, dst)) |
| 275 |
self.fs.dev.rpc.file_archive.assert_called_once_with( |
| 276 |
source="test/tgz.txt", destination="test/xyz", compress=True |
| 277 |
) |
| 278 |
|
| 279 |
@patch("jnpr.junos.Device.execute") |
| 280 |
def test_tgz_return_error(self, mock_execute): |
| 281 |
mock_execute.side_effect = self._mock_manager |
| 282 |
src = "test/tgz.txt" |
| 283 |
dst = "test/xyz" |
| 284 |
self.assertTrue("testing tgz" in self.fs.tgz(src, dst)) |
| 285 |
|
| 286 |
@patch("jnpr.junos.utils.fs.StartShell") |
| 287 |
def test_rmdir(self, mock_StartShell): |
| 288 |
path = "test/rmdir" |
| 289 |
print(self.fs.rmdir(path)) |
| 290 |
calls = [ |
| 291 |
call().__enter__(), |
| 292 |
call().__enter__().run("rmdir test/rmdir"), |
| 293 |
call().__exit__(None, None, None), |
| 294 |
] |
| 295 |
mock_StartShell.assert_has_calls(calls) |
| 296 |
|
| 297 |
@patch("jnpr.junos.utils.fs.StartShell") |
| 298 |
def test_mkdir(self, mock_StartShell): |
| 299 |
path = "test/mkdir" |
| 300 |
print(self.fs.mkdir(path)) |
| 301 |
calls = [ |
| 302 |
call().__enter__(), |
| 303 |
call().__enter__().run("mkdir -p test/mkdir"), |
| 304 |
call().__exit__(None, None, None), |
| 305 |
] |
| 306 |
mock_StartShell.assert_has_calls(calls) |
| 307 |
|
| 308 |
@patch("jnpr.junos.utils.fs.StartShell") |
| 309 |
def test_symlink(self, mock_StartShell): |
| 310 |
src = "test/tgz.txt" |
| 311 |
dst = "test/xyz" |
| 312 |
print(self.fs.symlink(src, dst)) |
| 313 |
calls = [ |
| 314 |
call().__enter__(), |
| 315 |
call().__enter__().run("ln -sf test/tgz.txt test/xyz"), |
| 316 |
call().__exit__(None, None, None), |
| 317 |
] |
| 318 |
mock_StartShell.assert_has_calls(calls) |
| 319 |
|
| 320 |
@patch("jnpr.junos.Device.execute") |
| 321 |
def test_storage_usage(self, mock_execute): |
| 322 |
mock_execute.side_effect = self._mock_manager |
| 323 |
self.assertEqual( |
| 324 |
self.fs.storage_usage(), |
| 325 |
{ |
| 326 |
"/dev/abc": { |
| 327 |
"avail_block": 234234, |
| 328 |
"used_blocks": 2346455, |
| 329 |
"used_pct": "1", |
| 330 |
"mount": "/", |
| 331 |
"total_blocks": 567431, |
| 332 |
"avail": "2F", |
| 333 |
"used": "481M", |
| 334 |
"total": "4F", |
| 335 |
} |
| 336 |
}, |
| 337 |
) |
| 338 |
|
| 339 |
@patch("jnpr.junos.Device.execute") |
| 340 |
def test_storage_usage_linux(self, mock_execute): |
| 341 |
mock_execute.side_effect = self._mock_manager_linux |
| 342 |
self.assertEqual( |
| 343 |
self.fs.storage_usage(), |
| 344 |
{ |
| 345 |
"re0": { |
| 346 |
"/dev/sda6": { |
| 347 |
"avail": "916M", |
| 348 |
"avail_block": 1874712, |
| 349 |
"mount": "/data/config", |
| 350 |
"total": "984M", |
| 351 |
"total_blocks": 2015024, |
| 352 |
"used": "1.4M", |
| 353 |
"used_blocks": 2688, |
| 354 |
"used_pct": "1", |
| 355 |
} |
| 356 |
} |
| 357 |
}, |
| 358 |
) |
| 359 |
|
| 360 |
@patch("jnpr.junos.Device.execute") |
| 361 |
def test_directory_usage(self, mock_execute): |
| 362 |
mock_execute.side_effect = self._mock_manager |
| 363 |
self.assertEqual( |
| 364 |
self.fs.directory_usage(path="/var/tmp", depth=1), |
| 365 |
{ |
| 366 |
"/var/tmp": {"blocks": 456076, "bytes": 233510912, "size": "223M"}, |
| 367 |
"/var/tmp/gres-tp": {"blocks": 68, "bytes": 34816, "size": "34K"}, |
| 368 |
"/var/tmp/install": {"blocks": 4, "bytes": 2048, "size": "2.0K"}, |
| 369 |
"/var/tmp/pics": {"blocks": 4, "bytes": 2048, "size": "2.0K"}, |
| 370 |
"/var/tmp/rtsdb": {"blocks": 4, "bytes": 2048, "size": "2.0K"}, |
| 371 |
"/var/tmp/sec-download": {"blocks": 8, "bytes": 4096, "size": "4.0K"}, |
| 372 |
"/var/tmp/vi.recover": {"blocks": 4, "bytes": 2048, "size": "2.0K"}, |
| 373 |
}, |
| 374 |
) |
| 375 |
|
| 376 |
@patch("jnpr.junos.Device.execute") |
| 377 |
def test_directory_usage_error(self, mock_execute): |
| 378 |
mock_execute.return_value = etree.fromstring( |
| 379 |
""" |
| 380 |
<directory-usage-information> |
| 381 |
<directory> |
| 382 |
<used-space used-blocks="456076"> |
| 383 |
223M |
| 384 |
</used-space> |
| 385 |
</directory> |
| 386 |
</directory-usage-information>""" |
| 387 |
) |
| 388 |
self.assertRaises(RpcError, self.fs.directory_usage, path="/var/tmp", depth=1) |
| 389 |
|
| 390 |
@patch("jnpr.junos.Device.execute") |
| 391 |
def test_directory_usage_no_directory(self, mock_execute): |
| 392 |
mock_execute.side_effect = self._mock_manager_error1 |
| 393 |
self.assertRaises(RpcError, self.fs.directory_usage, path="/var/tmp", depth="1") |
| 394 |
|
| 395 |
@patch("jnpr.junos.Device.execute") |
| 396 |
def test_directory_usage_no_dir_name(self, mock_execute): |
| 397 |
mock_execute.side_effect = self._mock_manager_error2 |
| 398 |
self.assertRaises(RpcError, self.fs.directory_usage, path="/var/tmp", depth="1") |
| 399 |
|
| 400 |
@patch("jnpr.junos.Device.execute") |
| 401 |
def test_storage_cleanup(self, mock_execute): |
| 402 |
mock_execute.side_effect = self._mock_manager |
| 403 |
self.assertEqual( |
| 404 |
self.fs.storage_cleanup(), |
| 405 |
{"/var/abc.txt": {"ts_date": "Apr 25 10:38", "size": 11}}, |
| 406 |
) |
| 407 |
|
| 408 |
@patch("jnpr.junos.Device.execute") |
| 409 |
def test_storage_cleanup_check(self, mock_execute): |
| 410 |
mock_execute.side_effect = self._mock_manager |
| 411 |
self.assertEqual( |
| 412 |
self.fs.storage_cleanup_check(), |
| 413 |
{"/var/abc.txt": {"ts_date": "Apr 25 10:38", "size": 11}}, |
| 414 |
) |
| 415 |
|
| 416 |
def _read_file(self, fname): |
| 417 |
from ncclient.xml_ import NCElement |
| 418 |
|
| 419 |
fpath = os.path.join(os.path.dirname(__file__), "rpc-reply", fname) |
| 420 |
foo = open(fpath).read() |
| 421 |
|
| 422 |
if ( |
| 423 |
fname == "get-rpc-error.xml" |
| 424 |
or fname == "get-index-error.xml" |
| 425 |
or fname == "get-system-core-dumps.xml" |
| 426 |
): |
| 427 |
rpc_reply = NCElement(foo, self.dev._conn._device_handler.transform_reply()) |
| 428 |
elif ( |
| 429 |
fname == "show-configuration.xml" |
| 430 |
or fname == "show-system-alarms.xml" |
| 431 |
or fname == "set-cli-working-directory.xml" |
| 432 |
): |
| 433 |
rpc_reply = NCElement( |
| 434 |
foo, self.dev._conn._device_handler.transform_reply() |
| 435 |
)._NCElement__doc |
| 436 |
else: |
| 437 |
rpc_reply = NCElement( |
| 438 |
foo, self.dev._conn._device_handler.transform_reply() |
| 439 |
)._NCElement__doc[0] |
| 440 |
return rpc_reply |
| 441 |
|
| 442 |
def _mock_manager(self, *args, **kwargs): |
| 443 |
if kwargs: |
| 444 |
# if 'path' in kwargs and 'detail' in kwargs: |
| 445 |
# return self._read_file('dir_list_detail.xml') |
| 446 |
|
| 447 |
if "path" in kwargs: |
| 448 |
if kwargs["path"] == "test/stat/decode_dir": |
| 449 |
return self._read_file("file-list_dir.xml") |
| 450 |
elif kwargs["path"] == "test/stat/decode_file": |
| 451 |
return self._read_file("file-list_file.xml") |
| 452 |
elif kwargs["path"] == "test/checksum": |
| 453 |
return self._read_file("checksum.xml") |
| 454 |
elif kwargs["path"] == "test/stat/decode_symbolic_link": |
| 455 |
return self._read_file("file-list_symlink.xml") |
| 456 |
if "directory" in kwargs: |
| 457 |
if kwargs["directory"] == "change/directory": |
| 458 |
return self._read_file("set-cli-working-directory.xml") |
| 459 |
if "filename" in kwargs: |
| 460 |
if kwargs["filename"] == "test/cat.txt": |
| 461 |
return self._read_file("file-show.xml") |
| 462 |
device_params = kwargs["device_params"] |
| 463 |
device_handler = make_device_handler(device_params) |
| 464 |
session = SSHSession(device_handler) |
| 465 |
return Manager(session, device_handler) |
| 466 |
|
| 467 |
elif args: |
| 468 |
if args[0].tag == "command": |
| 469 |
if args[0].text == "show cli directory": |
| 470 |
return self._read_file("show-cli-directory.xml") |
| 471 |
elif args[0].tag == "get-system-storage": |
| 472 |
return self._read_file("get-system-storage.xml") |
| 473 |
elif args[0].tag == "get-directory-usage-information": |
| 474 |
return self._read_file("get-directory-usage-information.xml") |
| 475 |
elif args[0].tag == "request-system-storage-cleanup": |
| 476 |
return self._read_file("request-system-storage-cleanup.xml") |
| 477 |
elif args[0].tag == "file-archive": |
| 478 |
return self._read_file("file-archive.xml") |
| 479 |
|
| 480 |
def _mock_manager_error1(self, *args, **kwargs): |
| 481 |
if args: |
| 482 |
if args[0].tag == "get-directory-usage-information": |
| 483 |
return self._read_file("get-directory-usage-information_error1.xml") |
| 484 |
|
| 485 |
def _mock_manager_error2(self, *args, **kwargs): |
| 486 |
if args: |
| 487 |
if args[0].tag == "get-directory-usage-information": |
| 488 |
return self._read_file("get-directory-usage-information_error2.xml") |
| 489 |
|
| 490 |
def _mock_manager_linux(self, *args, **kwargs): |
| 491 |
if args: |
| 492 |
if args[0].tag == "get-system-storage": |
| 493 |
return self._read_file("get-storage-usage-linux.xml") |