Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.11.0
    • Component/s: Core

      Description

      Add a new dns record type for GEO

      It may only be zerigo specific but it is a DNS record type of GEO that is not included in the library. I am guessing it could be added to libcloud/dns/types.py class RecordType as:

      GEO = 13

      And seeing as the types are not DNS RFC compliant and matched on decimal value that should be OK.
      And then a RECORD_TYPE_MAP of GEO in libcloud/dns/drivers/zerigo.py I guess.. I do not know the full complexities of the libcloud framework, debugging and working through it as I go.

      If that sounds about right, asign to me and I will patch.

      1. LIBCLOUD-203.patch
        1 kB
        Gary Wilson
      2. LIBCLOUD-203.patch
        1 kB
        Gary Wilson

        Activity

        Hide
        earthgecko Gary Wilson added a comment -

        No worries, happy to be able to contribute.

        Show
        earthgecko Gary Wilson added a comment - No worries, happy to be able to contribute.
        Hide
        kami Tomaz Muraus added a comment -

        Merged into trunk, thanks.

        Show
        kami Tomaz Muraus added a comment - Merged into trunk, thanks.
        Hide
        earthgecko Gary Wilson added a comment -

        Adding DNS Record Type of GEO for dns.zerigo

        Show
        earthgecko Gary Wilson added a comment - Adding DNS Record Type of GEO for dns.zerigo
        Hide
        earthgecko Gary Wilson added a comment - - edited

        Attaching LIBCLOUD-203.patch

        All tox OK and coverage tests OK.

        I am appending this issue with the how to setup an ubuntu box as a libcloud dev box and have tox and all the stuff set up and all the git commands, etc. Just in case it helps someone else do it quicker.

        The following is in textile markup but... should be OK

        branch.LIBCLOUD-203

        <pre>

        1. Install tools for libcloud dev
          sudo apt-get install python-pip python-dev build-essential
          sudo pip install tox
          sudo pip install mock
          sudo pip install coverage

        GITHUB_DIR=/opt/github
        git clone https://github.com/apache/libcloud.git
        cd $GITHUB_DIR/libcloud
        git checkout trunk
        git checkout -b LIBCLOUD-203

        1. Make modifications to code and modify test file (or run tox and figure out what tests fail and then modify as approriate)
        2. Modified:
        3. libcloud/dns/types.py
        4. libcloud/dns/drivers/zerigo.py
        5. libcloud/tests/dns/drivers/zerigo.py
          cd $GITHUB_DIR/libcloud
          cp test/secrets.py-dist test/secrets.py
          tox
          </pre>

        tox.results

        Note - [TOX] ERROR: InterpreterNotFound: python2.7 type errors are expected as all the pyton versions will not be available.

        <pre>
        ----------------------------------------------------------------------
        Ran 1623 tests in 15.624s

        OK
        _______________________________________________________________________________ [tox testenv:py27] _______________________________________________________________________________
        [TOX] ***creating virtualenv py27
        [TOX] ERROR: InterpreterNotFound: python2.7
        _______________________________________________________________________________ [tox testenv:pypy] _______________________________________________________________________________
        [TOX] ***creating virtualenv pypy
        [TOX] ERROR: InterpreterNotFound: pypy
        _______________________________________________________________________________ [tox testenv:py32] _______________________________________________________________________________
        [TOX] ***creating virtualenv py32
        [TOX] ERROR: InterpreterNotFound: python3.2
        _________________________________________________________________________________ [tox summary] __________________________________________________________________________________
        [TOX] ERROR: py25: InterpreterNotFound: python2.5
        [TOX] py26: commands succeeded
        [TOX] ERROR: py27: InterpreterNotFound: python2.7
        [TOX] ERROR: pypy: InterpreterNotFound: pypy
        [TOX] ERROR: py32: InterpreterNotFound: python3.2
        </pre>

        coverage report

        <pre>
        cd $GITHUB_DIR/libcloud
        PYTHONPATH=. python setup.py coverage
        </pre>

        Output and you can open coverage_html_report/index.html and see how it looks..

        <pre>
        ...
        ...
        Doctest: libcloud.dns.drivers.dummy.DummyDNSDriver.list_record_types ... ok
        Doctest: libcloud.dns.drivers.dummy.DummyDNSDriver.list_zones ... ok

        ----------------------------------------------------------------------
        Ran 1623 tests in 13.325s

        OK
        </pre>

        git patch and commit

        <pre>
        cd $GITHUB_DIR/libcloud
        git commit -am "IssueID #203: LIBCLOUD-203
        URL: https://issues.apache.org/jira/browse/LIBCLOUD-203
        Added new DNS Record Type of GEO
        All tox OK
        Modified:
        libcloud/dns/types.py
        libcloud/dns/drivers/zerigo.py
        libcloud/tests/dns/drivers/zerigo.py"
        git format-patch --no-prefix --stdout trunk > LIBCLOUD-203.patch
        git diff --no-prefix trunk LIBCLOUD-203 > LIBCLOUD-203.patch
        git push origin LIBCLOUD-203

        1. Attach patch to LIBCLOUD-203 issue
        2. And for next time... switch back to trunk..
          git checkout trunk
          </pre>
        Show
        earthgecko Gary Wilson added a comment - - edited Attaching LIBCLOUD-203 .patch All tox OK and coverage tests OK. I am appending this issue with the how to setup an ubuntu box as a libcloud dev box and have tox and all the stuff set up and all the git commands, etc. Just in case it helps someone else do it quicker. The following is in textile markup but... should be OK branch. LIBCLOUD-203 <pre> Install tools for libcloud dev sudo apt-get install python-pip python-dev build-essential sudo pip install tox sudo pip install mock sudo pip install coverage GITHUB_DIR=/opt/github git clone https://github.com/apache/libcloud.git cd $GITHUB_DIR/libcloud git checkout trunk git checkout -b LIBCLOUD-203 Make modifications to code and modify test file (or run tox and figure out what tests fail and then modify as approriate) Modified: libcloud/dns/types.py libcloud/dns/drivers/zerigo.py libcloud/tests/dns/drivers/zerigo.py cd $GITHUB_DIR/libcloud cp test/secrets.py-dist test/secrets.py tox </pre> tox.results Note - [TOX] ERROR: InterpreterNotFound: python2.7 type errors are expected as all the pyton versions will not be available. <pre> ---------------------------------------------------------------------- Ran 1623 tests in 15.624s OK _______________________________________________________________________________ [tox testenv:py27] _______________________________________________________________________________ [TOX] ***creating virtualenv py27 [TOX] ERROR: InterpreterNotFound: python2.7 _______________________________________________________________________________ [tox testenv:pypy] _______________________________________________________________________________ [TOX] ***creating virtualenv pypy [TOX] ERROR: InterpreterNotFound: pypy _______________________________________________________________________________ [tox testenv:py32] _______________________________________________________________________________ [TOX] ***creating virtualenv py32 [TOX] ERROR: InterpreterNotFound: python3.2 _________________________________________________________________________________ [tox summary] __________________________________________________________________________________ [TOX] ERROR: py25: InterpreterNotFound: python2.5 [TOX] py26: commands succeeded [TOX] ERROR: py27: InterpreterNotFound: python2.7 [TOX] ERROR: pypy: InterpreterNotFound: pypy [TOX] ERROR: py32: InterpreterNotFound: python3.2 </pre> coverage report <pre> cd $GITHUB_DIR/libcloud PYTHONPATH=. python setup.py coverage </pre> Output and you can open coverage_html_report/index.html and see how it looks.. <pre> ... ... Doctest: libcloud.dns.drivers.dummy.DummyDNSDriver.list_record_types ... ok Doctest: libcloud.dns.drivers.dummy.DummyDNSDriver.list_zones ... ok ---------------------------------------------------------------------- Ran 1623 tests in 13.325s OK </pre> git patch and commit <pre> cd $GITHUB_DIR/libcloud git commit -am "IssueID #203: LIBCLOUD-203 URL: https://issues.apache.org/jira/browse/LIBCLOUD-203 Added new DNS Record Type of GEO All tox OK Modified: libcloud/dns/types.py libcloud/dns/drivers/zerigo.py libcloud/tests/dns/drivers/zerigo.py" git format-patch --no-prefix --stdout trunk > LIBCLOUD-203 .patch git diff --no-prefix trunk LIBCLOUD-203 > LIBCLOUD-203 .patch git push origin LIBCLOUD-203 Attach patch to LIBCLOUD-203 issue And for next time... switch back to trunk.. git checkout trunk </pre>
        Hide
        earthgecko Gary Wilson added a comment -

        Adding a new DNS Record Type - GEO

        Show
        earthgecko Gary Wilson added a comment - Adding a new DNS Record Type - GEO
        Hide
        kami Tomaz Muraus added a comment -

        Yeah, that sounds correct. Add it to RecordType class / enum and then update RECORD_TYPE_MAP in the zerigo driver. Also don't forget to add tests.

        Show
        kami Tomaz Muraus added a comment - Yeah, that sounds correct. Add it to RecordType class / enum and then update RECORD_TYPE_MAP in the zerigo driver. Also don't forget to add tests.

          People

          • Assignee:
            kami Tomaz Muraus
            Reporter:
            earthgecko Gary Wilson
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development