Skip to content

Commit e49fc2c

Browse files
authored
Merge pull request #142 from rstudio/mbh-jupyter-testing-bugs
Address a few nits and a bug
2 parents 3278cb9 + 1ec36aa commit e49fc2c

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

rsconnect/actions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def test_server(connect_server):
188188
key = connect_server.api_key
189189
insecure = connect_server.insecure
190190
ca_data = connect_server.ca_data
191-
failures = ["Invalid server URL: %s" % url]
191+
failures = []
192192
for test in _to_server_check_list(url):
193193
try:
194194
connect_server = api.RSConnectServer(test, key, insecure, ca_data)
@@ -198,8 +198,8 @@ def test_server(connect_server):
198198
failures.append(" %s - failed to verify as RStudio Connect." % test)
199199

200200
# In case the user may need https instead of http...
201-
if len(failures) == 2 and url.startswith("http://"):
202-
failures.append(' Do you need to use "https://%s?"' % url[7:])
201+
if len(failures) == 1 and url.startswith("http://"):
202+
failures.append(' Do you need to use "https://%s"?' % url[7:])
203203

204204
# If we're here, nothing worked.
205205
raise api.RSConnectException("\n".join(failures))

rsconnect/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def handle_bad_response(self, response):
4747
error = "The Connect server reported an error: %s" % response.json_data["error"]
4848
raise RSConnectException(error)
4949
raise RSConnectException(
50-
"Received and unexpected response from RStudio Connect: %s %s" % (response.status, response.reason)
50+
"Received an unexpected response from RStudio Connect: %s %s" % (response.status, response.reason)
5151
)
5252

5353

rsconnect/environment.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ def detect_environment(dirname, force_generate=False, conda_mode=False, conda=No
7575

7676
if result is not None:
7777
if conda_mode and result["package_manager"] != "conda":
78-
return {
79-
"error": 'Conda was requested but no activated Conda environment was found. See "conda activate '
78+
return Environment(
79+
error='Conda was requested but no activated Conda environment was found. See "conda activate '
8080
'--help" for more information.'
81-
}
81+
)
8282

8383
result["python"] = get_python_version(Environment(**result))
8484
result["pip"] = get_version("pip")

0 commit comments

Comments
 (0)