summaryrefslogtreecommitdiff
path: root/gstudio/management
diff options
context:
space:
mode:
authoramita singh <amitacr@gmail.com>2012-05-25 15:30:57 +0530
committeramita singh <amitacr@gmail.com>2012-05-25 15:30:57 +0530
commit217b435377e7ae911bd8c47d13fda75a90d305df (patch)
tree744cc87b81b143700ab3c58ff6dc48f22773966e /gstudio/management
parenta6e51038363f855d21bf3910fa8cc2c9bf9cb432 (diff)
parent877ab256f5943bb1c617d176e8af2b142ed3547b (diff)
downloadgnowsys-217b435377e7ae911bd8c47d13fda75a90d305df.tar.gz
Merge remote-tracking branch 'gn1/master'
Diffstat (limited to 'gstudio/management')
-rw-r--r--gstudio/management/commands/register-peer.py74
1 files changed, 37 insertions, 37 deletions
diff --git a/gstudio/management/commands/register-peer.py b/gstudio/management/commands/register-peer.py
index a068b2f..afe2b50 100644
--- a/gstudio/management/commands/register-peer.py
+++ b/gstudio/management/commands/register-peer.py
@@ -13,40 +13,40 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from django.core.management.base import BaseCommand
-from optparse import make_option
-import sys
-from gstudio.models import Peer
-
-class Command(BaseCommand):
- """Custom manage.py command to register a peer"""
- option_list = BaseCommand.option_list + (
- make_option("--ip", action="store", type="string",
- dest="ip", help="Specify an IP"),
- make_option("--pkey", action="store", type="string",
- dest="pkey", help="Specify a public-key"))
-
- def handle(self, *args, **options):
- try:
- ip = options["ip"]
- pkey = options["pkey"]
-
- if not ip:
- sys.stderr.write("Please specify an IP\n")
- sys.exit(2)
-
- if not pkey:
- sys.stderr.write("Please specify a public-key\n")
- sys.exit(2)
-
- pkey = open(options["pkey"]).readline().rstrip()
-
- except (IOError, TypeError):
- sys.stderr.write("Please specify a correct public-key\n")
- sys.exit(2)
-
- ip = Peer(ip="{0}".format(ip))
- ip.save()
-
- pkey = Peer(pkey="{0}".format(pkey))
- pkey.save()
+# from django.core.management.base import BaseCommand
+# from optparse import make_option
+# import sys
+# from gstudio.models import Peer
+
+# class Command(BaseCommand):
+# """Custom manage.py command to register a peer"""
+# option_list = BaseCommand.option_list + (
+# make_option("--ip", action="store", type="string",
+# dest="ip", help="Specify an IP"),
+# make_option("--pkey", action="store", type="string",
+# dest="pkey", help="Specify a public-key"))
+
+# def handle(self, *args, **options):
+# try:
+# ip = options["ip"]
+# pkey = options["pkey"]
+
+# if not ip:
+# sys.stderr.write("Please specify an IP\n")
+# sys.exit(2)
+
+# if not pkey:
+# sys.stderr.write("Please specify a public-key\n")
+# sys.exit(2)
+
+# pkey = open(options["pkey"]).readline().rstrip()
+
+# except (IOError, TypeError):
+# sys.stderr.write("Please specify a correct public-key\n")
+# sys.exit(2)
+
+# ip = Peer(ip="{0}".format(ip))
+# ip.save()
+
+# pkey = Peer(pkey="{0}".format(pkey))
+# pkey.save()