# parsing repository urls - not yet fixed?

**URL:** <https://forum.ansible.com/t/parsing-repository-urls-not-yet-fixed/16262>\
**Category:** Ansible Project\
**Created:** [September 17, 2014, 8:40pm UTC](https://forum.ansible.com/t/parsing-repository-urls-not-yet-fixed/16262 "2014-09-17T20:40:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tobias\_Gesellchen](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@Tobias\_Gesellchen](https://forum.ansible.com/u/Tobias_Gesellchen)\
**Post date:** [September 17, 2014, 8:40pm UTC](https://forum.ansible.com/t/parsing-repository-urls-not-yet-fixed/16262/1 "2014-09-17T20:40:27Z")

</div>

Hi,

the recent changes regarding the repository strings with private registry urls seem to be missing a detail. Looking at the changes for [https://github.com/ansible/ansible/issues/8983](https://github.com/ansible/ansible/issues/8983) only the trailing tag seems to be recognized, but no “username” infix.  
Please have a look at [https://github.com/docker/docker/blob/master/pkg/parsers/parsers.go#L72](https://github.com/docker/docker/blob/master/pkg/parsers/parsers.go#L72) where the “official” logic for parsing a canonical repository url is implemented.

Did anyone have a chance to try a repository url like below?

localhost.localdomain:5000/samalba/hipache:latest

Thanks for your feedback!

---

<div class="post-metadata">

**Author:** ![Toshio\_Kuratomi](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@Toshio\_Kuratomi](https://forum.ansible.com/u/Toshio_Kuratomi)\
**Post date:** [September 18, 2014, 12:08am UTC](https://forum.ansible.com/t/parsing-repository-urls-not-yet-fixed/16262/2 "2014-09-18T00:08:14Z")

</div>

Hi,

> the recent changes regarding the repository strings with private registry  
> urls seem to be missing a detail. Looking at the changes for  
> [https://github.com/ansible/ansible/issues/8983](https://github.com/ansible/ansible/issues/8983) only the trailing tag  
> seems to be recognized, but no "username" infix.  
> Please have a look at  
> [https://github.com/docker/docker/blob/master/pkg/parsers/parsers.go#L72](https://github.com/docker/docker/blob/master/pkg/parsers/parsers.go#L72)  
> where the "official" logic for parsing a canonical repository url is  
> implemented.
> 
> Did anyone have a chance to try a repository url like below?
> 
> localhost.localdomain:5000/samalba/hipache:latest
> 
> That gets parsed into:

('localhost.localdomain:5000/samalba/hipache', 'latest')

Is that not what it's supposed to be?

(Note: there's been several commits fixing bugs and then fixing bugs  
introduced by fixes in recent days so if you're just looking at issues,  
make sure that you also have had a chance to look at the latest version of  
the code in the devel tree).

-Toshio

---

<div class="post-metadata">

**Author:** ![Ben\_Symonds](https://avatars.discourse-cdn.com/v4/letter/b/f6c823/32.png) [@Ben\_Symonds](https://forum.ansible.com/u/Ben_Symonds)\
**Post date:** [September 18, 2014, 9:06am UTC](https://forum.ansible.com/t/parsing-repository-urls-not-yet-fixed/16262/3 "2014-09-18T09:06:40Z")

</div>

You guys should really start unit testing this stuff! I think it would save a lot of pain.

---

<div class="post-metadata">

**Author:** ![Toshio\_Kuratomi](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@Toshio\_Kuratomi](https://forum.ansible.com/u/Toshio_Kuratomi)\
**Post date:** [September 18, 2014, 2:24pm UTC](https://forum.ansible.com/t/parsing-repository-urls-not-yet-fixed/16262/4 "2014-09-18T14:24:11Z")

</div>

> You guys should really start unit testing this stuff! I think it would save a lot of pain.

Unfortunately, this code is in a module so it can’t be unittested as is. Because of just how much I’ve had to touch this piece of code I’ve been thinking about whether we should design a way to either make modules unittestable or splitting out the chunks of code that are ripe for unittesting.

Stay tuned 🙂

-Toshio
