targetcli 3.0.0.dev0__tar.gz → 3.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,3 +20,4 @@ repos:
20
20
  - id: debug-statements
21
21
  - id: end-of-file-fixer
22
22
  - id: trailing-whitespace
23
+ args: [--markdown-linebreak-ext=md]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: targetcli
3
- Version: 3.0.0.dev0
3
+ Version: 3.0.1
4
4
  Summary: A command shell for managing the Linux LIO kernel target
5
5
  Project-URL: Homepage, http://github.com/open-iscsi/targetcli-fb
6
6
  Author-email: Andy Grover <agrover@redhat.com>
@@ -50,10 +50,10 @@ Contribute
50
50
  ----------
51
51
  targetcli complies with PEP 621 and as such can be built and installed with tools like `build` and `pip`.
52
52
 
53
- For development, consider using [Hatch](https://hatch.pypa.io):
54
- `hatch shell` to create and enter a Python virtualenv with the project installed in editable mode
55
- `pre-commit install` to enable pre-commit hooks
56
- `hatch build` to create tarball and wheel
53
+ For development, consider using [Hatch](https://hatch.pypa.io):
54
+ `hatch shell` to create and enter a Python virtualenv with the project installed in editable mode
55
+ `pre-commit install` to enable pre-commit hooks
56
+ `hatch build` to create tarball and wheel
57
57
 
58
58
  "fb" -- "free branch"
59
59
  ---------------------
@@ -31,10 +31,10 @@ Contribute
31
31
  ----------
32
32
  targetcli complies with PEP 621 and as such can be built and installed with tools like `build` and `pip`.
33
33
 
34
- For development, consider using [Hatch](https://hatch.pypa.io):
35
- `hatch shell` to create and enter a Python virtualenv with the project installed in editable mode
36
- `pre-commit install` to enable pre-commit hooks
37
- `hatch build` to create tarball and wheel
34
+ For development, consider using [Hatch](https://hatch.pypa.io):
35
+ `hatch shell` to create and enter a Python virtualenv with the project installed in editable mode
36
+ `pre-commit install` to enable pre-commit hooks
37
+ `hatch build` to create tarball and wheel
38
38
 
39
39
  "fb" -- "free branch"
40
40
  ---------------------
@@ -26,8 +26,8 @@ import struct
26
26
  import sys
27
27
  from os import getenv, getuid
28
28
 
29
- from configshell_fb import ConfigShell, ExecutionError
30
- from rtslib_fb import RTSLibError
29
+ from configshell import ConfigShell, ExecutionError
30
+ from rtslib import RTSLibError
31
31
 
32
32
  from targetcli import __version__ as targetcli_version
33
33
  from targetcli.ui_root import UIRoot
@@ -308,11 +308,11 @@ def main():
308
308
  if not is_root:
309
309
  shell.con.display("You are not root, disabling privileged commands.\n")
310
310
 
311
- try:
312
- while not shell._exit:
311
+ while not shell._exit:
312
+ try:
313
313
  shell.run_interactive()
314
- except (RTSLibError, ExecutionError) as msg:
315
- shell.log.error(str(msg))
314
+ except (RTSLibError, ExecutionError) as msg: # noqa: PERF203 - would otherwise exit shell
315
+ shell.log.error(str(msg))
316
316
 
317
317
  if shell.prefs['auto_save_on_exit'] and is_root:
318
318
  shell.log.info("Global pref auto_save_on_exit=true")
@@ -31,7 +31,7 @@ from os import getenv, getuid
31
31
  from pathlib import Path
32
32
  from threading import Thread
33
33
 
34
- from configshell_fb import ConfigShell
34
+ from configshell import ConfigShell
35
35
 
36
36
  from targetcli import __version__ as targetcli_version
37
37
  from targetcli.ui_root import UIRoot
@@ -26,9 +26,9 @@ import stat
26
26
  import struct
27
27
  from pathlib import Path
28
28
 
29
- from configshell_fb import ExecutionError
29
+ from configshell import ExecutionError
30
30
  from gi.repository import Gio
31
- from rtslib_fb import (
31
+ from rtslib import (
32
32
  ALUATargetPortGroup,
33
33
  BlockStorageObject,
34
34
  FileIOStorageObject,
@@ -38,7 +38,7 @@ from rtslib_fb import (
38
38
  RTSRoot,
39
39
  UserBackedStorageObject,
40
40
  )
41
- from rtslib_fb.utils import get_block_type
41
+ from rtslib.utils import get_block_type
42
42
 
43
43
  from .ui_node import UINode, UIRTSLibNode
44
44
 
@@ -18,7 +18,7 @@ under the License.
18
18
  '''
19
19
 
20
20
 
21
- from configshell_fb import ConfigNode, ExecutionError
21
+ from configshell import ConfigNode, ExecutionError
22
22
 
23
23
 
24
24
  class UINode(ConfigNode):
@@ -26,9 +26,9 @@ from datetime import datetime
26
26
  from glob import glob
27
27
  from pathlib import Path, PurePosixPath
28
28
 
29
- from configshell_fb import ExecutionError
30
- from rtslib_fb import RTSRoot
31
- from rtslib_fb.utils import ignored
29
+ from configshell import ExecutionError
30
+ from rtslib import RTSRoot
31
+ from rtslib.utils import ignored
32
32
 
33
33
  from targetcli import __version__
34
34
 
@@ -24,8 +24,8 @@ except ImportError:
24
24
  ethtool = None
25
25
  import stat
26
26
 
27
- from configshell_fb import ExecutionError
28
- from rtslib_fb import (
27
+ from configshell import ExecutionError
28
+ from rtslib import (
29
29
  LUN,
30
30
  TPG,
31
31
  MappedLUN,
@@ -43,6 +43,7 @@ from .ui_node import UINode, UIRTSLibNode
43
43
  auth_params = ('userid', 'password', 'mutual_userid', 'mutual_password')
44
44
  int_params = ('enable',)
45
45
  discovery_params = auth_params + int_params
46
+ default_portal_listen = "::0"
46
47
 
47
48
  class UIFabricModule(UIRTSLibNode):
48
49
  '''
@@ -340,10 +341,10 @@ class UIMultiTPGTarget(UIRTSLibNode):
340
341
 
341
342
  if tpg.has_feature("nps") and self.shell.prefs['auto_add_default_portal']:
342
343
  try:
343
- NetworkPortal(tpg, "0.0.0.0")
344
+ NetworkPortal(tpg, f"[{default_portal_listen}]")
344
345
  self.shell.log.info("Global pref auto_add_default_portal=true")
345
346
  self.shell.log.info("Created default portal listening on all IPs"
346
- " (0.0.0.0), port 3260.")
347
+ f" ({default_portal_listen}), port 3260.")
347
348
  except RTSLibError:
348
349
  self.shell.log.info("Default portal not created, TPGs within a target cannot share ip:port.")
349
350
 
@@ -1280,9 +1281,9 @@ class UIPortals(UINode):
1280
1281
  Creates a Network Portal with the specified IP address and
1281
1282
  port. If the port is omitted, the default port for
1282
1283
  the target fabric will be used. If the IP address is omitted,
1283
- INADDR_ANY (0.0.0.0) will be used.
1284
+ IN6ADDR_ANY (::0) will be used.
1284
1285
 
1285
- Choosing IN6ADDR_ANY (::0) will listen on all IPv6 interfaces
1286
+ The default IN6ADDR_ANY (::0) will listen on all IPv6 interfaces
1286
1287
  as well as IPv4, assuming IPV6_V6ONLY sockopt has not been
1287
1288
  set.
1288
1289
 
@@ -1298,12 +1299,12 @@ class UIPortals(UINode):
1298
1299
  # FIXME: Add a specfile parameter to determine default port
1299
1300
  default_port = 3260
1300
1301
  ip_port = self.ui_eval_param(ip_port, 'number', default_port)
1301
- ip_address = self.ui_eval_param(ip_address, 'string', "0.0.0.0")
1302
+ ip_address = self.ui_eval_param(ip_address, 'string', default_portal_listen)
1302
1303
 
1303
1304
  if ip_port == default_port:
1304
1305
  self.shell.log.info("Using default IP port %d" % ip_port)
1305
- if ip_address == "0.0.0.0":
1306
- self.shell.log.info("Binding to INADDR_ANY (0.0.0.0)")
1306
+ if ip_address == default_portal_listen:
1307
+ self.shell.log.info(f"Binding to INADDR_ANY ({default_portal_listen})")
1307
1308
 
1308
1309
  portal = NetworkPortal(self.tpg, self._canonicalize_ip(ip_address),
1309
1310
  ip_port, mode='create')
@@ -159,9 +159,10 @@ ports. These addr:port pairs are called
159
159
  Both IPv4 and IPv6 addresses are supported.
160
160
  .P
161
161
  When a target is created, targetcli automatically creates a default
162
- portal listening on all IPv4 addresses (shown as 0.0.0.0) on port 3260.
163
- If a different configuration is needed, the default portal can be
164
- removed and portals configured as desired.
162
+ portal listening on all IPv4 and IPv6 addresses (shown as ::0) on port
163
+ 3260. If IPV6_V6ONLY is set, the default will only listen on all IPv6
164
+ addresses. If a different configuration is needed, the default portal can
165
+ be removed and portals configured as desired.
165
166
  .P
166
167
  If the hardware supports it,
167
168
  .B iSER
@@ -299,7 +300,7 @@ target.)
299
300
  .B portals/ create
300
301
  .br
301
302
  Add a portal, i.e. an IP address and TCP port via which the target can
302
- be contacted by initiators. Only required if the default 0.0.0.0:3260
303
+ be contacted by initiators. Only required if the default [::0]:3260
303
304
  portal is not present.
304
305
  .P
305
306
  .B luns/ create /backstores/fileio/disk1
File without changes
File without changes
File without changes
File without changes
File without changes