Skip to content

Commit

Permalink
delete some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yangang committed Aug 18, 2017
1 parent 083ca30 commit dcc04bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
9 changes: 0 additions & 9 deletions contents/winsmbcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,8 @@ def mkdirs(path,
with open('/tmp/winsmbcp.log', 'a+') as fp_:
fp_.write('cwd:{0}\n'.format(cwd))
try:
# print 'list path:{0}'.format(cwd)
conn.listPath(share, cwd)
except (smbSessionError, smb3SessionError) as exc:
# print 'create directory {0}\{1}'.format(share, cwd)
conn.createDirectory(share, cwd)
pos += 1

Expand All @@ -75,11 +73,9 @@ def put_file(src_file, dest_dir, hostname, username, password):
dest_file = '/'.join(dest_comps[1:])
mid_path = '/'.join(dest_comps[1:-1])

# smb_conn = salt.utils.smb.get_conn(hostname, username, password)
smb_conn = get_conn(hostname, username, password)
mkdirs(mid_path, share, smb_conn)

# with salt.utils.fopen(src_file, 'rb') as inst_fh:
with open(src_file, 'rb') as inst_fh:
smb_conn.putFile(share, '{0}'.format(dest_file), inst_fh.read)

Expand All @@ -95,8 +91,3 @@ def put_file(src_file, dest_dir, hostname, username, password):
fp_.write('src_file:{0}\n dest_dir:{1}\n'.format(src_file, dest_dir))

put_file(src_file, dest_dir, hostname, username, password)


import os

os.path.join()
3 changes: 2 additions & 1 deletion contents/winsmbexe.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ def win_cmd(exe_command, **kwargs):
logging_command=logging_command, )

if logging_command is None:
log.info('Executing command(PID %s): \'%s\'', proc.pid, exe_command)
log.info('Executing command(PID %s): \'%s\'', proc.pid,
exe_command)
else:
log.info('Executing command(PID %s): \'%s\'', proc.pid,
logging_command)
Expand Down

0 comments on commit dcc04bb

Please sign in to comment.