diff options
author | Nikita Karetnikov <nikita.karetnikov@gmail.com> | 2012-04-28 23:36:39 +0400 |
---|---|---|
committer | Nikita Karetnikov <nikita.karetnikov@gmail.com> | 2012-04-28 23:36:39 +0400 |
commit | 3941914112be631c1c149703631b069c0e790a0f (patch) | |
tree | 0f1188ead226bc1a5ce779cef1096f99ce177798 /gstudio/management | |
parent | 80ae25b8ec38ba00eded83d7341dee851e77e838 (diff) | |
download | gnowsys-3941914112be631c1c149703631b069c0e790a0f.tar.gz |
Disabled register-peer.py
Diffstat (limited to 'gstudio/management')
-rw-r--r-- | gstudio/management/commands/register-peer.py | 74 |
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() |