Skip to content
Snippets Groups Projects
  1. Mar 27, 2019
    • Benjamin Bertrand's avatar
      Increase timeout for core services update · 27b44173
      Benjamin Bertrand authored
      As the core service update doesn't depend anymore on each other but only
      on the inventory update, 2 can be launched almost at the same time.
      As they can't run in parallel, the second one will only start when the
      first one is done, meaning that it can take more than 180 seconds to
      complete.
      
      Increasing the timeout to 500 seconds should avoid the task to be
      reported as failed when it just took longer to run.
      
      JIRA INFRA-895 #action In Progress
      27b44173
  2. Mar 18, 2019
    • Benjamin Bertrand's avatar
      Trigger AWX inventory update on database change · e000c2f0
      Benjamin Bertrand authored
      A job running in AWX prevents an inventory sync (of the same
      inventory). This restricts AWX to run only one job at a time as
      the inventory is always updated on launch.
      To prevent this issue, the inventory is updated from AWX when needed.
      
      - The update is triggered on any model modification that is used in the
      inventory (AnsibleGroup, Cname, Domain, Host, Network, NetworkScope)
      - For Interface, the inventory sync is triggered by the
      trigger_core_services function as it depends on it
      - The inventory update job is put on the "high" queue so that it takes
      precedence over all other jobs.
      
      JIRA INFRA-887 #action In Progress
      e000c2f0
    • Benjamin Bertrand's avatar
      Use queues of different priorities · f30a711b
      Benjamin Bertrand authored
      Ensure that the trigger_core_services_update job is always processed
      before the other jobs (low queue).
      
      JIRA INFRA-887
      f30a711b
  3. Mar 05, 2019
    • Benjamin Bertrand's avatar
      Allow to launch a workflow job · 7cdc15f4
      Benjamin Bertrand authored
      New resource argument can be passed to launch_job_template.
      It is optional and is set to "job" by default.
      Shall be set to "workflow_job" to run a workflow template.
      
      Note that passing the workflow name didn't work during my test.
      The id had to be used instead.
      
      JIRA INFRA-867 #action In Progress
      7cdc15f4
  4. Jan 25, 2019
    • Benjamin Bertrand's avatar
      Fix case insensitive search · 67b2f815
      Benjamin Bertrand authored
      Search on keyword can be made case insensitive by using a normalizer.
      But some fields with type keyword include several words.
      They are only returned by entering all words. This is not what
      most users expect.
      
      It's better to use the "text" type by default (for text fields) and add
      an extra "keyword" field of type "keyword" for sorting.
      
      JIRA INFRA-770
      67b2f815
  5. Dec 18, 2018
  6. Nov 29, 2018
  7. Oct 12, 2018
  8. Oct 11, 2018
    • Benjamin Bertrand's avatar
      Implement server side processing for network hosts · 3a2d05fa
      Benjamin Bertrand authored
      - switch to server side processing to retrieve network hosts
        (the table started to be bigger and takes time to load)
      - add full text search using elasticsearch
      
      Note that only the first IP is displayed in the host table (all
      interfaces were displayed before). Search can be performed on any
      interfaces.
      
      JIRA INFRA-595 #action In Progress
      3a2d05fa
  9. Oct 05, 2018
  10. Sep 28, 2018
    • Benjamin Bertrand's avatar
      Add button to export items to excel file · 8471ec5b
      Benjamin Bertrand authored
      Retrieving all items from the database takes some time.
      The task is thus handled by the RQ worker.
      We use ajax to periodically monitor the status of the job
      and redirect to the file when ready.
      A progress bar is displayed to let the user see the progress.
      
      The mechanism put in place could be re-used for other use cases.
      
      JIRA INFRA-545 #action In Progress
      8471ec5b
  11. Aug 08, 2018
    • Benjamin Bertrand's avatar
      Replace jwt decorators with flask-login · fb3f568e
      Benjamin Bertrand authored
      Using flask-login request_loader, we can validate jwt tokens.
      This allows to use the same decorators for the web UI (using cookies)
      and the API (using JWT) as well as the current_user local proxy.
      fb3f568e
  12. Jul 12, 2018
  13. Jul 11, 2018
  14. Jul 09, 2018
    • Benjamin Bertrand's avatar
      Use sqlalchemy events hook to trigger tasks · d9516a98
      Benjamin Bertrand authored
      Use the before_flush hook to trigger the core services update.
      It's much nicer than having to call a method in several places.
      
      The core services update is triggered on creation/modification/deletion
      of an Interface.
      
      In the before_flush we can manipulate the session (add objects) but we
      shouldn't call commit.
      The db.session.commit() was removed from the launch_task method.
      d9516a98
  15. Jul 06, 2018
  16. Apr 23, 2018
    • Benjamin Bertrand's avatar
      Add stack_member field to item · ce031db6
      Benjamin Bertrand authored
      This is to be used for stack of switches only
      
      - a stack_member is linked to an host (device_type has to be "Switch")
      - a stack_member is an integer between 0 and 9 (included) or can be None
      - the couple (host_id, stack_member) must be unique
      
      JIRA INFRA-267
      ce031db6
  17. Apr 09, 2018
    • Benjamin Bertrand's avatar
      Sort network names in the register new host form · c302b5e3
      Benjamin Bertrand authored
      The sorting of the models was done in the utils.get_model_choices
      funtion but a specific query was passed to not display admin_only networks.
      
      The sorting is now done even when passing a specific query to
      get_model_choices.
      
      JIRA INFRA-284
      c302b5e3
    • Benjamin Bertrand's avatar
      Add attributes favorites page · 3050ce17
      Benjamin Bertrand authored
      - create many-to-many relationships between the user table and
      attributes tables (manufacturer / model / location / status / action)
      - add a checkbox as the first column of the attributes table to add or
      remove an attribute to the favorites
      - add a new page to display the favorite attributes
      
      JIRA INFRA-283
      3050ce17
  18. Feb 26, 2018
    • Benjamin Bertrand's avatar
      Fix broken test · 815463b9
      Benjamin Bertrand authored
      Fix error:
      User instance is not bound to a Session; attribute refresh operation cannot proceed
      815463b9
  19. Feb 12, 2018
    • Benjamin Bertrand's avatar
      Allow admin to create interface outside range · a653f0d9
      Benjamin Bertrand authored
      The network range defines the IP to be allocated.
      This is to reserve some specific addresses (for gateway for example).
      
      An admin user should be able to define an interface outside the network
      range.
      
      The IP address select field was replaced with a string field
      (initialized to the first available IP).
      
      Fixes INFRA-200
      a653f0d9
  20. Feb 09, 2018
  21. Jan 08, 2018
  22. Dec 22, 2017
  23. Dec 21, 2017
  24. Dec 19, 2017
  25. Dec 15, 2017
    • Benjamin Bertrand's avatar
      Fix validation error when field is disabled · 2db946d2
      Benjamin Bertrand authored
      If a selectfield is disabled, None is returned (not a string).
      To pass wtforms validation, that value shall be part of the choices.
      
      We use None as the value for SelectField that are optional (instead of
      '').
      We were previously converting '' to None when creating a model.
      We now use the coerce function to let the form convert 'None' to None.
      2db946d2
  26. Dec 06, 2017
  27. Nov 15, 2017
  28. Nov 03, 2017
  29. Sep 07, 2017
  30. Sep 06, 2017
    • Benjamin Bertrand's avatar
      Add page to create QR codes · 99536bdd
      Benjamin Bertrand authored
      This can be done via the Admin interface but this latter shall be
      restricted to admin users. This simple page allows the group "create"
      to easily add new Manufacturer, Model or Location.
      99536bdd
    • Benjamin Bertrand's avatar
      Replace hash with specific ICS Id (3 letters + 3 digits) · fe73933d
      Benjamin Bertrand authored
      The serial number might not be unique and can't be used
      as the string to hash.
      There are for example SD cards that all have the same SN.
      
      Using an ICS id allows to pre-print labels that can be assigned to
      hardware when scanning serial numbers.
      This id shall be easy to remember (unlike UUID).
      fe73933d
  31. Aug 18, 2017
  32. Jul 20, 2017
  33. Jul 19, 2017
    • Benjamin Bertrand's avatar
      Fix hash computation in admin view · 74437b80
      Benjamin Bertrand authored
      The hash is supposed to be computed in the __init__ method of Item.
      But flask-admin never passes any parameter when creating the model class.
      The attributes are changed after creation.
      
      When creating an item in the admin view, we use the on_model_change
      method to update the hash.
      
      There might be a better way to avoid this code duplication.
      This works for now.
      74437b80
Loading