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

Allow cluster select without explicit endpoint for local testing #178

Merged
1 change: 1 addition & 0 deletions src/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Change Log
Unreleased
----------
- Improve help text on cluster select (#173)
- Cluster select defaults to endpoint http://localhost:19080 is none is provided (#)

7.0.2
----------
Expand Down
15 changes: 7 additions & 8 deletions src/sfctl/custom_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,28 +108,27 @@ def _get_rest_client(endpoint, cert=None, key=None, pem=None, ca=None, # pylint
)


def select(endpoint, cert=None, key=None, pem=None, ca=None, #pylint: disable=invalid-name, too-many-arguments
def select(endpoint='http://localhost:19080', cert=None, key=None, pem=None, ca=None, #pylint: disable=invalid-name, too-many-arguments
aad=False, no_verify=False):
#pylint: disable-msg=too-many-locals
"""
Connects to a Service Fabric cluster endpoint.
If connecting to secure cluster, specify an absolute path to a cert (.crt)
and key file (.key) or a single file with both (.pem). Do not specify both.
Optionally, if connecting to a secure cluster, also specify an absolute
path to a CA bundle file or directory of trusted CA certs. If using a
directory of CA certs, `c_rehash <directory>` provided by OpenSSL must be run first to compute
the certificate hashes and create the appropriate symbolics links.
path to a CA bundle file or directory of trusted CA certs.

Typically, the endpoint will look something like https://<your-url>:19080
If no endpoint is given, it will default to http://localhost:19080.

:param str endpoint: Cluster endpoint URL, including port and HTTP or HTTPS
prefix
prefix. Typically, the endpoint will look something like https://<your-url>:19080
:param str cert: Absolute path to a client certificate file
:param str key: Absolute path to client certificate key file
:param str pem: Absolute path to client certificate, as a .pem file
:param str ca: Absolute path to CA certs directory to treat as valid
or CA bundle
file
or CA bundle file. If using a
directory of CA certs, `c_rehash <directory>` provided by OpenSSL must be run first to compute
the certificate hashes and create the appropriate symbolics links.
:param bool aad: Use Azure Active Directory for authentication
:param bool no_verify: Disable verification for certificates when using
HTTPS, note: this is an insecure option and should not be used for
Expand Down