Re: [osv-dev] [PATCH] Signed-off-by: BassMatt

2019-12-15 Thread Nadav Har'El
On Fri, Dec 13, 2019 at 10:02 AM Pekka Enberg  wrote:

> On Thu, Dec 12, 2019 at 10:02 PM BassMatt  wrote:
> >
> > Main scripts in scripts/ folder updated to use Python3
> >
> > I went through the scripts detailed in scripts/README and updated them
> to use Python3. I used the Python "Future" module to provide suggestions,
> then manually went through and applied the changes. The "Future" module
> gives suggestions to allow for cross-compatibility between Python2/3, but
> since it was expressed that only Python3 needed to be supported, I left all
> that out.
> >
> > The issue is detailed here:
> > https://github.com/cloudius-systems/osv/issues/1056


Thanks.

Does this solve the issue completely (you fixed all the scripts) or
partially?
If completely, you should use the text "Fixes #1056". This will cause
github, when this patch is committed, to automatically close this issue.
If it only partially solves the issue, please explain why (what remains?)
and use the text "Refs #1056" - this will cause github to put a mention of
this commit on the issue, but not close it.


>
>
> Looks good, thanks!
>
> Acked-by: Pekka Enberg 
>
> I assume this is you:
>
> https://github.com/BassMatt
>
> Please fix the sign-off to be:
>
> Signed-off-by: Real Name 
>

Also please put the Signed-off-by line at the end of the commit message -
not as the first line.
The first line of the commit message becomes the commit's title, and should
be informative.


> as per contributions guide:
>
> https://github.com/cloudius-systems/osv/blob/master/CONTRIBUTING
>
> - Pekka
>
> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osv-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/osv-dev/CAGUyND8PC%3DD0ctpO0FxX6mJhBJTxr0d1jiF3-zGRLg_16UCn%3Dw%40mail.gmail.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/CANEVyjuxKUH3xj3oifkiYNptOyVeoSqQOo2PAfQG_Rov-sD8aA%40mail.gmail.com.


Re: [osv-dev] [PATCH] Signed-off-by: BassMatt

2019-12-13 Thread Pekka Enberg
On Thu, Dec 12, 2019 at 10:02 PM BassMatt  wrote:
>
> Main scripts in scripts/ folder updated to use Python3
>
> I went through the scripts detailed in scripts/README and updated them to use 
> Python3. I used the Python "Future" module to provide suggestions, then 
> manually went through and applied the changes. The "Future" module gives 
> suggestions to allow for cross-compatibility between Python2/3, but since it 
> was expressed that only Python3 needed to be supported, I left all that out.
>
> The issue is detailed here:
> https://github.com/cloudius-systems/osv/issues/1056

Looks good, thanks!

Acked-by: Pekka Enberg 

I assume this is you:

https://github.com/BassMatt

Please fix the sign-off to be:

Signed-off-by: Real Name 

as per contributions guide:

https://github.com/cloudius-systems/osv/blob/master/CONTRIBUTING

- Pekka

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/CAGUyND8PC%3DD0ctpO0FxX6mJhBJTxr0d1jiF3-zGRLg_16UCn%3Dw%40mail.gmail.com.


[osv-dev] [PATCH] Signed-off-by: BassMatt

2019-12-12 Thread BassMatt
Main scripts in scripts/ folder updated to use Python3

I went through the scripts detailed in scripts/README and updated them to use 
Python3. I used the Python "Future" module to provide suggestions, then 
manually went through and applied the changes. The "Future" module gives 
suggestions to allow for cross-compatibility between Python2/3, but since it 
was expressed that only Python3 needed to be supported, I left all that out.

The issue is detailed here:
https://github.com/cloudius-systems/osv/issues/1056
---
 scripts/export_manifest.py | 14 +-
 scripts/firecracker.py |  4 +--
 scripts/gen-rofs-img.py| 18 ++--
 scripts/loader.py  | 57 ++
 scripts/metadata.py|  6 ++--
 scripts/mkbootfs.py|  7 ++---
 scripts/module.py  |  4 +--
 scripts/setup.py   | 10 +++
 scripts/test.py|  6 ++--
 scripts/tests/testing.py   |  4 +--
 scripts/upload_manifest.py | 12 ++--
 11 files changed, 65 insertions(+), 77 deletions(-)

diff --git a/scripts/export_manifest.py b/scripts/export_manifest.py
index 5e8fb4e7..370b1f29 100755
--- a/scripts/export_manifest.py
+++ b/scripts/export_manifest.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 import optparse, os, shutil
 from manifest_common import add_var, expand, unsymlink, read_manifest, 
defines, strip_file
@@ -8,7 +8,7 @@ from manifest_common import add_var, expand, unsymlink, 
read_manifest, defines,
 # support for links in OSv, e.g., /etc/mnttab: ->/proc/mounts.
 def export_package(manifest, dest):
 abs_dest = os.path.abspath(dest)
-print "[INFO] exporting into directory %s" % abs_dest
+print("[INFO] exporting into directory %s" % abs_dest)
 
 # Remove and create the base directory where we are going to put all 
package files.
 if os.path.exists(abs_dest):
@@ -39,7 +39,7 @@ def export_package(manifest, dest):
 os.makedirs(target_dir)
 
 os.symlink(link_source, name)
-print "[INFO] added link %s -> %s" % (name, link_source)
+print("[INFO] added link %s -> %s" % (name, link_source))
 
 else:
 # If it is a symlink, then resolve it add to the list of host 
symlinks to be created later
@@ -58,23 +58,23 @@ def export_package(manifest, dest):
 hostname = strip_file(hostname)
 
 shutil.copy(hostname, name)
-print "[INFO] exported %s" % name
+print("[INFO] exported %s" % name)
 elif os.path.isdir(hostname):
 # If hostname is a dir, it is only a request to create the 
folder on guest. Nothing to copy.
 if not os.path.exists(name):
 os.makedirs(name)
-print "[INFO] created dir %s" % name
+print("[INFO] created dir %s" % name)
 
 else:
 # Inform the user that the rule cannot be applied. For 
example, this happens for links in OSv.
-print "[ERR] unable to export %s" % hostname
+print("[ERR] unable to export %s" % hostname)
 
 for link_source, name in host_symlinks:
 target_dir = os.path.dirname(name)
 if not os.path.exists(target_dir):
 os.makedirs(target_dir)
 os.symlink(link_source, name)
-print "[INFO] added link %s -> %s" % (name, link_source)
+print("[INFO] added link %s -> %s" % (name, link_source))
 
 def main():
 make_option = optparse.make_option
diff --git a/scripts/firecracker.py b/scripts/firecracker.py
index 3f21081d..5c98b0ee 100755
--- a/scripts/firecracker.py
+++ b/scripts/firecracker.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 # pip install requests-unixsocket
 import sys
@@ -182,7 +182,7 @@ def find_firecracker(dirname):
 if not os.path.exists(firecracker_path):
 url_base = 
'https://github.com/firecracker-microvm/firecracker/releases/download'
 download_url = '%s/%s/firecracker-%s' % (url_base, 
firecracker_version, firecracker_version)
-answer = raw_input("Firecracker executable has not been found under 
%s. "
+answer = input("Firecracker executable has not been found under %s. "
"Would you like to download it from %s and place it 
under %s? [y|n]" %
(firecracker_path, download_url, firecracker_path))
 if answer.capitalize() != 'Y':
diff --git a/scripts/gen-rofs-img.py b/scripts/gen-rofs-img.py
index e825c639..8904a870 100755
--- a/scripts/gen-rofs-img.py
+++ b/scripts/gen-rofs-img.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 #
 # Copyright (c) 2015 Carnegie Mellon University.
@@ -218,13 +218,13 @@ def write_dir(fp, manifest, dirpath, parent_dir):
 inode.data_offset = symlinks_count
 inode.count = 1
 next_symlink(val[2:],manifest)
-print 'Link %s to %s' % (dirpath +