Relax restrictions on TPG Tag range
Currently rtslib forbids TPG Tag 0. According to
https://tools.ietf.org/html/rfc7143#section-13.9 this is perfectly legal
value, and I've tested it with Linux, Windows, ESXi and AIX initiators.
This commit relaxes the restriction and allows TPG Tag to be 0. I've
kept current behavior in automatic tags assignment so nothing changes
there (e.g. the first TPG will be 1 unless the user explicitly tells
otherwise).
Consus
3 years ago
158 | 158 | @param parent_target: The parent Target object of the TPG. |
159 | 159 | @type parent_target: Target |
160 | 160 | @param tag: The TPG Tag (TPGT). |
161 | @type tag: int > 0 | |
161 | @type tag: positive int | |
162 | 162 | @param mode:An optionnal string containing the object creation mode: |
163 | 163 | - I{'any'} means the configFS object will be either looked up or |
164 | 164 | created. |
180 | 180 | raise RTSLibError("Cannot find an available TPG Tag") |
181 | 181 | else: |
182 | 182 | tag = int(tag) |
183 | if not tag > 0: | |
184 | raise RTSLibError("The TPG Tag must be >0") | |
183 | if tag < 0: | |
184 | raise RTSLibError("The TPG Tag must be >=0") | |
185 | 185 | self._tag = tag |
186 | 186 | |
187 | 187 | if isinstance(parent_target, Target): |