-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from ambitus/gh-pages-robust-error-updates
Gh pages robust error updates
- Loading branch information
Showing
71 changed files
with
487 additions
and
386 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
layout: default | ||
parent: Common | ||
--- | ||
|
||
# Add Operation Error | ||
|
||
Understanding the `AddOperationError` exception. | ||
{: .fs-6 .fw-300 } | ||
|
||
| ||
|
||
{: .note } | ||
> _An **Add** operation targeting an existing profile could end up effectively performing an **Alter** operation on an existing profile. pyRACF will always raise an `AddOperationError` and **refuse** to perform the requested operation to bring attention to this condition._ | ||
| ||
|
||
Prior to executing an **Add** operation, a **Profile Extract** is attempted to determine whether the profile already exists. If the **Return Code** and the **Messages** returned by the **Profile Extract** operation indicate that the profile already exists, an `AddOperationError` will be raised and the requested **Add** operation will **NOT** be executed. An `AddOperationError` can be handled as follows. | ||
|
||
###### Python Script | ||
```python | ||
from pyracf import UserAdmin | ||
from pyracf import AddOperationError | ||
|
||
user_admin = UserAdmin() | ||
|
||
try: | ||
user_admin.add("squidwrd") | ||
except AddOperationError as e: | ||
print(e.message) | ||
``` | ||
|
||
###### Console Output | ||
```console | ||
Refusing to make security request to IRRSMO00. | ||
|
||
Target profile 'squidwrd' already exists as a 'user' profile. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
layout: default | ||
parent: Common | ||
--- | ||
|
||
# Alter Operation Error | ||
|
||
Understanding the `AlterOperationError` exception. | ||
{: .fs-6 .fw-300 } | ||
|
||
| ||
|
||
{: .note} | ||
> _An **Alter** operation targeting a profile that does **NOT** exist already could end up effectively performing an **Add** operation to create a new profile. pyRACF will always raise an `AlterOperationError` and refuse to perform the requested operation to bring attention to this condition._ | ||
| ||
|
||
Prior to executing an **Alter** operation, a **Profile Extract** is attempted to determine whether the profile already exists. If the **Return Code** and the **Messages** returned by the **Extract** operation indicate that the profile does **NOT** exist, an `AlterOperationError` will be raised and the requseted **Alter** operation will **NOT** be executed. An `AlterOperationError` can be handled as follows. | ||
|
||
###### Python Script | ||
```python | ||
from pyracf import UserAdmin | ||
from pyracf import AlterOperationError | ||
|
||
user_admin = UserAdmin() | ||
|
||
try: | ||
user_admin.alter("squidwrd") | ||
except AlterOperationError as e: | ||
print(e.message) | ||
``` | ||
|
||
###### Console Output | ||
```console | ||
Refusing to make security request to IRRSMO00. | ||
|
||
Target profile 'squidwrd' does not exist as a 'user' profile. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
layout: default | ||
parent: Common | ||
--- | ||
|
||
# Segment Error | ||
|
||
Understanding the `SegmentError` exception. | ||
{: .fs-6 .fw-300 } | ||
|
||
| ||
|
||
When an unknown **Segment** is provided in the parameters to a **Profile Extract** request, a `SegmentError` will be raised to indicate that the request cannot be built. A `SegmentError` can be handled as follows. | ||
|
||
###### Python Script | ||
```python | ||
from pyracf import UserAdmin | ||
from pyracf import SegmentError | ||
|
||
user_admin = UserAdmin() | ||
|
||
try: | ||
user_admin.extract("squidwrd", segments=["ovms","rso"]) | ||
except SegmentError as e: | ||
print(e.message) | ||
``` | ||
|
||
###### Console Output | ||
```console | ||
Unable to build Security Request. | ||
|
||
'rso' is not a known segment for 'user'. | ||
'ovms' is not a known segment for 'user'. | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
layout: default | ||
parent: Common | ||
--- | ||
|
||
# Segment Trait Error | ||
|
||
Understanding the `SegmentTraitError` exception. | ||
{: .fs-6 .fw-300 } | ||
|
||
|
||
| ||
|
||
When any unknown **Segment-Trait Combination** is provided in the parameters to a **Non-Profile Extract** request, a `SegmentTraitError` will be raised to indicate that the request cannot be built. A `SegmentTraitError` can be handled as follows. | ||
|
||
###### Python Script | ||
```python | ||
from pyracf import UserAdmin | ||
from pyracf import SegmentError | ||
|
||
user_admin = UserAdmin() | ||
traits = { | ||
"base:name": "Squidward", | ||
"base:passwrd": "K29521IO", | ||
"base:owner": "leonard", | ||
"base:special": False, | ||
"base:operations": True, | ||
"omvs:uid": 2424, | ||
"omvs:home": "/u/squidwrd", | ||
"omvs:program": "/bin/sh", | ||
} | ||
|
||
try: | ||
user_admin.alter("squidwrd", traits=traits) | ||
except SegmentTraitError as e: | ||
print(e.message) | ||
``` | ||
|
||
###### Console Output | ||
```console | ||
Unable to build Security Request. | ||
|
||
'base:passwrd' is not a known segment-trait combination for 'user'. | ||
'ovms:home' is not a known segment-trait combination for 'user'. | ||
'ovms:program' is not a known segment-trait combination for 'user'. | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.