1. 15 Nov, 2015 2 commits
    • Kirill Smelkov's avatar
      util/sqlite_connect: Allow 8-bit strings · af7de08e
      Kirill Smelkov authored
      Because e.g. for the following instance parameters
      
          <?xml version='1.0' encoding='utf-8'?>
          <instance>
            <parameter id="text">Привет Мир!</parameter>
          </instance>
      
      we get the following DB query
      
          'UPDATE %s SET slap_state="busy" ,software_release=? ,partition_reference=? ,requested_by=? ,software_type=? ,xml=? WHERE
      reference=? AND computer_reference=?',
          ['http://sr//', 'myinstance', 'slappart0', 'default',
           '<?xml version=\'1.0\' encoding=\'utf-8\'?>\n<instance>\n  <parameter id="text">\xd0\x9f\xd1\x80\xd0\xb8\xd0\xb2\xd0\xb5\xd1\x82\xd0\x9c\xd0\xb8\xd1\x80!</parameter>\n</instance>\n',
           'slappart6', 'computer']
      
      which fails the following way:
      
        File ".../site-packages/flask/app.py", line 1817, in wsgi_app
          response = self.full_dispatch_request()
        File ".../site-packages/flask/app.py", line 1477, in full_dispatch_request
          rv = self.handle_user_exception(e)
        File ".../site-packages/flask/app.py", line 1381, in handle_user_exception
          reraise(exc_type, exc_value, tb)
        File ".../site-packages/flask/app.py", line 1475, in full_dispatch_request
          rv = self.dispatch_request()
        File ".../site-packages/flask/app.py", line 1461, in dispatch_request
          return self.view_functions[rule.endpoint](**req.view_args)
        File "slapos/proxy/views.py", line 393, in requestComputerPartition
          software_instance = requestNotSlave(**parsed_request_dict)
        File "slapos/proxy/views.py", line 609, in requestNotSlave
          execute_db('partition', q, args)
        File "slapos/proxy/views.py", line 142, in execute_db
          cur = db.execute(query, args)
      ProgrammingError: You must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings (like text_factory = str). It is highly recommended that you instead just switch your application to Unicode strings.
      
      our instance parameters is always XML UTF-8 encoded, and thus it is not
      unicode and we cannot go the 'use unicode always' way.
      
      So autotune sqlite connections on open to support 8-bit strings.
      af7de08e
    • Kirill Smelkov's avatar
      *: Factor opening sqlite db into separate function · 8bf68261
      Kirill Smelkov authored
      Currently it is just sqlite3.connect(), but we'll want to add connection
      autotuning in the next patch, so before that let's consolidate all
      sqlite opening places in the code into one.
      8bf68261
  2. 13 Nov, 2015 2 commits
  3. 27 Oct, 2015 2 commits
  4. 26 Oct, 2015 2 commits
  5. 15 Oct, 2015 4 commits
  6. 02 Oct, 2015 1 commit
  7. 29 Sep, 2015 1 commit
  8. 25 Sep, 2015 2 commits
  9. 03 Sep, 2015 1 commit
  10. 21 Aug, 2015 1 commit
  11. 17 Jul, 2015 4 commits
  12. 16 Jul, 2015 1 commit
  13. 11 May, 2015 1 commit
  14. 28 Apr, 2015 2 commits
  15. 24 Apr, 2015 2 commits
  16. 22 Apr, 2015 4 commits
  17. 25 Mar, 2015 3 commits
  18. 20 Mar, 2015 2 commits
  19. 19 Mar, 2015 1 commit
  20. 17 Mar, 2015 2 commits
    • Alain Takoudjou's avatar
    • Alain Takoudjou's avatar
      Introduce slapos format with create tap but without bridge · 684c6366
      Alain Takoudjou authored
      If user set create_tap to True then specify an interface (tap_gateway_interface) to use as gateway for
      guest vm connected to tap interface, slapformat will configure route
      to reache each guest from host: "route add -host tap_ip dev slaptapXX",
      where tap_ip belong to the same network as the ip on tap_gateway_interface.
      slapformat will also create network information for each tap
      who will be used to configure network in guest vm.
      
      This is a begining to create cluster of vm which are connected to
      each other using tap interface, without bridge.
      684c6366