Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use server_config as named argument only #1152

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/create_organization_nailgun.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def main():
auth=('admin', 'changeme'), # Use these credentials…
url='https://sat1.example.com', # …to talk to this server.
)
org = Organization(server_config, name='junk org').create()
org = Organization(server_config=server_config, name='junk org').create()
pprint(org.get_values()) # e.g. {'name': 'junk org', …}
org.delete()

Expand Down
8 changes: 5 additions & 3 deletions docs/create_user_nailgun.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ def main():
"""Create an identical user account on a pair of satellites."""
server_configs = ServerConfig.get('sat1'), ServerConfig.get('sat2')
for server_config in server_configs:
org = Organization(server_config).search(query={'search': 'name="Default_Organization"'})[0]
org = Organization(server_config=server_config).search(
query={'search': 'name="Default_Organization"'}
)[0]
# The LDAP authentication source with an ID of 1 is internal. It is
# nearly guaranteed to exist and be functioning.
user = User(
server_config,
auth_source=1, # or: AuthSourceLDAP(server_config, id=1),
server_config=server_config,
auth_source=1, # or: AuthSourceLDAP(server_config=server_config, id=1),
login='Alice',
mail='alice@example.com',
organization=[org],
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ save some of our work for later re-use::
... auth=('admin', 'changeme'), # Use these credentials…
... url='https://sat1.example.com', # …to talk to this server.
... ) # More options are available, e.g. disabling SSL verification.
>>> org = Organization(server_config, name='junk org').create()
>>> org = Organization(server_config=server_config, name='junk org').create()
>>> org.name == 'junk org' # Access all attrs likewise, e.g. `org.label`
True
>>> org.delete()
Expand Down
Loading
Loading