Skip to content

Conversation

@ryanusahk
Copy link

@ryanusahk ryanusahk commented Aug 15, 2018

Note that it doesn't support connecting with passwords and instead requires ssh keys.

Copy link
Member

@antgonza antgonza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You currently have a missing import: ImportError: No module named paramiko

.travis.yml Outdated
dist: precise
language: python
sudo: false
sudo: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return to false

<td width="30px">&nbsp;</td>
<td>
<button type="button" class="btn btn-light" onclick="$('input[name*=\'files_to_erase\']').removeAttr('checked');">Select None</button>
<button type="button" class="btn btn-light" onclick="$('input[name*=\'files_to_erase\']').removeAttr('checked');">Unselect All</button>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means that you have to do: git pull upstream dev


def private_task(job_id):
"""Complets a Qiita private task
"""Completes a Qiita private task
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@codecov-io
Copy link

Codecov Report

Merging #2642 into dev will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev    #2642   +/-   ##
=======================================
  Coverage   94.34%   94.34%           
=======================================
  Files         164      164           
  Lines       19416    19416           
=======================================
  Hits        18318    18318           
  Misses       1098     1098

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c75e17e...6642710. Read the comment docs.

@antgonza
Copy link
Member

@ElDeveloper, could you take a look? Thanks!

Copy link
Contributor

@ElDeveloper ElDeveloper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, but there's a few things that we've (me and @charles-cowart) noted.

.gitignore Outdated
# webdis log
webdis.log

# test keys should generated in travis
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should generated -> should be generated

Parameters
----------
URL : urlparse object
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

URL -> p_url

port = p_url.port
username = p_url.username

if scheme == 'scp' or scheme == 'sftp':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs an alternative branch that raises an appropriate exception if the scheme is not supported.

if scheme == 'scp' or scheme == 'sftp':

# if port not specified, use default 22 as port
if not port:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be more explicit about the port not being specified. It should be if port is None:

if not port:
port = 22

# step 1: both schemes requires an SSH connection
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

requires -> require

url = job.parameters.values['url']
private_key = job.parameters.values['private_key']
try:
list_remote(url, private_key)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is happening to the output of this function, it seems like it is not being utilized anywhere and that this job does nothing(?)

read_file_list = list_remote('scp://localhost:'+self.remote_dir_path,
self.test_ssh_key)
remote_filename_list = [basename(f) for f in
glob(join(self.remote_dir_path, '*'))]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wildcard doesn't seem consistent with the checks, since we only allow the extensions that are described in the qiita config file. I would suggest that the expected list be hardcoded instead.

self.assertEqual(remote_filename_list, local_filename_list)

def test_download_sftp(self):
"""Tests remote file listing using private key and sftp"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be Tests remote file downloading ...

read_file_list = list_remote('sftp://localhost:'+self.remote_dir_path,
self.test_ssh_key)
remote_filename_list = [basename(f) for f in
glob(join(self.remote_dir_path, '*'))]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

download_remote('scp://localhost:'+self.remote_dir_path,
self.test_ssh_key, self.temp_local_dir)
remote_filename_list = [basename(f) for f in
glob(join(self.remote_dir_path, '*'))]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

@antgonza
Copy link
Member

antgonza commented Sep 5, 2018

This PR has been superseded by #2660

@antgonza antgonza closed this Sep 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants