4 Replies Latest reply: Aug 19, 2014 11:56 AM by Rossel Vermette RSS

Import geo location IP

Rossel Vermette

Hey,

 

I've created 2x files for the geo locations for my environment and followed the syntax using the samples that were in the examples directory.

 

Locations.txt

"SITE1-cc1",49.89147,-97.1425

"SITE1-cc2",49.89147,-97.1425

"SITE1-cc3",49.89147,-97.1425

"SITE1-cc4",49.89147,-97.1425

"SITE1-cc5",49.89147,-97.1425

 

IPs.txt

"SITE1-cc1","10.7.11.0","255.255.255.0"

"SITE1-cc1","10.7.12.0","255.255.255.0"

"SITE1-cc2","10.7.21.0","255.255.255.0"

"SITE1-cc3","10.7.31.0","255.255.255.0"

"SITE1-cc4","10.7.41.0","255.255.255.0"

 

I can then import in the locations.txt file no problem using the command: `python manage.py locations --import-locations ./Locations.txt` and can see the entries in the admin portal.

When I try to run the import for the IPs using the following command: `python manage.py locations --import-location-ip ./IPs.txt`  I get the following error:

KeyError : 'Unknown location: SITE1-cc1'.

 

If I go thought the admin portal, I'm able to add the location-ips individually one at a time, but would love for a bulk import to work.

Anyone have any ideas?

  • Re: Import geo location IP
    Mike Garabedian

    Hi Rossel,

     

    We actually have a fix for that already committed to github, and should have a new version of steelscript-appfwk posted to PyPI shortly.

     

    -Mike

  • Re: Import geo location IP
    Mike Garabedian

    Rossel,

     

    Updated SteelScript packages have been posted - you can get the updated versions by running the following command:

     

         $ steel install --upgrade --appfwk

     

    Once this is complete, you may need to reset your existing project if you have errors (there have been some minor database changes).

     

    Let us know if you run into any issues!

     

    -Mike

    • Re: Import geo location IP
      Rossel Vermette

      Ok,

      Ran the update:

      1# steel install --upgrade --appfwk

      /usr/local/bin/steel:5: UserWarning: Module _markerlib was already imported from /usr/local/lib/python2.7/dist                                             -packages/distribute-0.6.49-py2.7.egg/_markerlib/__init__.pyc, but /usr/local/lib/python2.7/dist-packages/setu                                             ptools-5.5-py2.7.egg is being added to sys.path

        from pkg_resources import load_entry_point

      Checking if pip is installed...done

      Installing steelscript...done

      Installing steelscript.netprofiler...done

      Installing steelscript.netshark...done

      Installing django-admin-tools...done

      Installing steelscript.appfwk...done

      Installing steelscript.wireshark...done

      Installing steelscript.appfwk.business-hours...done

       

       

      Now if i run the steel about I get the following errors:

      # steel about

      /usr/local/bin/steel:5: UserWarning: Module _markerlib was already imported from /usr/local/lib/python2.7/dist                                             -packages/distribute-0.6.49-py2.7.egg/_markerlib/__init__.pyc, but /usr/local/lib/python2.7/dist-packages/setu                                             ptools-5.5-py2.7.egg is being added to sys.path

        from pkg_resources import load_entry_point

      Traceback (most recent call last):

        File "/usr/local/bin/steel", line 9, in <module>

          load_entry_point('steelscript==0.9.3', 'console_scripts', 'steel')()

        File "/usr/local/lib/python2.7/dist-packages/steelscript/commands/steel.py", line 968, in run

          cmd.parse(sys.argv[1:])

        File "/usr/local/lib/python2.7/dist-packages/steelscript/commands/steel.py", line 257, in parse

          subcmds = [subcmd for subcmd in self.subcommands

        File "/usr/local/lib/python2.7/dist-packages/steelscript/commands/steel.py", line 351, in subcommands

          i = obj.load(obj)

        File "/usr/local/lib/python2.7/dist-packages/distribute-0.6.49-py2.7.egg/pkg_resources.py", line 2086, in lo                                             ad

          if require: self.require(env, installer)

        File "/usr/local/lib/python2.7/dist-packages/distribute-0.6.49-py2.7.egg/pkg_resources.py", line 2099, in re                                             quire

          working_set.resolve(self.dist.requires(self.extras),env,installer))

        File "/usr/local/lib/python2.7/dist-packages/distribute-0.6.49-py2.7.egg/pkg_resources.py", line 600, in res                                             olve

          raise VersionConflict(dist,req) # XXX put more info here

      pkg_resources.VersionConflict: (django-announcements 1.0.2 (/usr/local/lib/python2.7/dist-packages), Requireme                                             nt.parse('django-announcements==1.2.0'))