Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1787 from apache/DATALAB-3099
Browse files Browse the repository at this point in the history
[DATALAB-3099]: added nmap exe removal
  • Loading branch information
leonidfrolov committed Nov 8, 2022
2 parents 7a65a4f + 5187fa7 commit b30eb37
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
sys.exit(1)

logging.info("Disable scp on nodes")
remove_scp_binary(args.user)
remove_scp_nmap_binary(args.user)

#logging.info("Updating openssh to version")
#ensure_openssh_version(args.user)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,12 @@ def find_java_path_local():
sys.exit(1)


def remove_scp_binary(os_user):
def remove_scp_nmap_binary(os_user):
try:
if not exists(datalab.fab.conn, '/home/{}/.ensure_dir/remove_scp_binary'.format(os_user)):
if not exists(datalab.fab.conn, '/home/{}/.ensure_dir/remove_scp_nmap_binary'.format(os_user)):
datalab.fab.conn.sudo('rm /usr/bin/scp')
datalab.fab.conn.sudo('touch /home/{}/.ensure_dir/remove_scp_binary'.format(os_user))
datalab.fab.conn.sudo('rm /usr/share/nmap/nselib/data/psexec/nmap_service.exe > /dev/null; echo $?')
datalab.fab.conn.sudo('touch /home/{}/.ensure_dir/remove_scp_nmap_binary'.format(os_user))
except Exception as err:
logging.error('Updating openssh to version:', str(err))
traceback.print_exc()
Expand Down

0 comments on commit b30eb37

Please sign in to comment.