/srv/irclogs.ubuntu.com/2013/12/11/#maas.txt

=== CyberJacob is now known as CyberJacob|Away
=== freeflying is now known as freeflying_away
rawanghello, anyone here?02:38
rawangwhile I run "maas-cli necadmin node-groups import-boot-images"02:38
rawangi got "    check_call(['sudo', '-n', '-E', 'maas-import-pxe-files'], env=env)02:38
rawang  File "/usr/lib/python2.7/subprocess.p    check_call(['sudo', '-n', '-E', 'maas-import-pxe-files'], env=env)02:38
rawang  File "/usr/lib/python2.7/subprocess.py", line 511, in check_call02:38
rawang    raise CalledProcessError(retcode, cmd)02:38
rawangCalledProcessError: CalledProcessError("y", line 511, in check_call02:38
rawang    raise CalledProcessError(retcode, cmd)02:38
rawangCalledProcessError: CalledProcessError(02:38
rawangjulianwa, hi02:46
rawanghello anyone?02:55
julianwarawang: hi02:56
rawangjulianwa, hi you didn't connect to the irc?02:56
rawangjulianwa, just quick question, can you login the irc, i'll pm you02:57
julianwarawang: I'm on it02:57
rawanghi guys, how do i know if maas-cli foo node-groups import-boot-images is finished or not?04:00
=== freeflying_away is now known as freeflying
rawanghi guys, how do i know if maas-cli foo node-groups import-boot-images is finished or not?05:46
=== freeflying is now known as freeflying_away
=== freeflying_away is now known as freeflying
=== CyberJacob|Away is now known as CyberJacob
jtvrvba: can't add a zone!  The "Add zone" page just looks like the zones listing that I just came from.08:54
rvbajtv: yeah, I know, this is not implemented yet :)08:54
jtvAh!  OK.  :)08:54
jtvI'll use the factory then.08:55
jtv(I added a factory method)08:55
rvbajtv: but the url exists, have a look in src/maasserver/urls.py08:55
rvbajtv: there is a factory method already08:55
rvbamake_zone()08:55
rvbajtv: also, I added 2 zones to the sampledata, for convenience.08:56
jtvrvba: the HTML on the form is pretty weird actually!08:57
rvbaWhich form?  The "edit node" form?08:57
jtvThe empty item reads: <option value selected="selected">---------</option>08:58
jtvYes, the "edit node" form.08:58
jtvThe zone dropdown, like you suggested.08:58
jtvNote how the "value" attribute has no value.08:58
rvbaThat's weird indeed.08:58
jtvIt's allowed in HTML5, but I don't know off the top of my head what representation you get.08:59
jtv(HTML allows this in its non-XML representation)08:59
jtvI'd better get into that middleware...09:00
rvbajtv: that's not what I see :)09:00
rvba<select id="id_zone" name="zone">09:01
rvba<option value="">---------</option>09:01
jtvrvba: different versions..?09:06
jtvI'm running django 1.5.4.09:06
rvbaSame here.09:07
rvbajtv: I think I know where the pb is.09:07
rvbaThe node->zone ForeignKey has null=True.09:08
jtvWhich sounded redundant to me, for a foreign key, but you're about to tell me that it means something unexpected, right?09:09
jtvHmmno, no difference when I remove the null=True.09:12
rvbaNo, because we need to regenerate the migration.09:13
jtv!09:13
jtvDoesn't the form logic just use whatever it currently sees in that code?09:14
jtvrvba: oops, when I leave the blank=True in place but remove the null=True, South thinks the field becomes NOT NULL!09:16
jtvrvba: I tried setting DEBUG, but where does the POST body get logged?09:16
rvbajtv: which is all right, but we should also add default=''09:16
jtvAdd it where?  For the model field definition we already have default=None09:17
rvbaWhich we should change to default=''09:17
rvbaNow, South has a problem with that apparently.09:17
rvbajtv: in maas.log09:17
jtvWTF that worked09:17
jtvmaas.log..?  This is a dev setup.09:18
rvbaThe appserver log then.09:18
jtvRemoving null=True and passing default='' got me past South, but it doesn't get the tests passing.  :(09:19
jtvAh, it said "nothing to migrate."09:20
jtvNo, no, that was a different run.09:20
jtvI grepped the webapp log earlier, but didn't see the recognizable string I passed in my POST parameters...  I'll re-generate and have a closer look.09:21
jtvrvba: I wonder if I set the DEBUG option in the right way and place...  Not exactly clear.09:24
jtvStill no POST bodies in the webapp logs.09:25
rvbaI removed null=True and passed default='' but now South errors when running the migration.09:26
jtvNot for me...  but it turns the database field into a text field!09:26
jtvWhich is... probably not what we want.09:26
rvbaIt is what we want I think.09:26
rvbaThe foreignkey points to the name of the zone.09:26
jtvAh09:27
jtvBut how can we have referential integrity in the database if the empty string is allowed there?09:27
jtv(At least, without creating a zone with an empty name)09:27
rvbaIsn't there provision for an "empty default"?  At the db level I mean.09:28
jtvYes, NULL.09:28
jtvSQL makes lots of sense.09:29
rvbaOkay, so I guess we need to use that then.09:29
jtvYes, it's definitely the appropriate choice from a database point of view.09:29
jtvBut what's the appropriate choice from the form's point of view..!?09:29
rvbaIt probably means we have to re-defined the choices the form uses.09:31
rvbare-define*09:31
rvbajtv: I'd be curious to know how you interpret https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ForeignKey.on_delete09:47
=== freeflying is now known as freeflying_away
=== freeflying_away is now known as freeflying
rvbajtv: my testing shows that the node's zone field is set to None when the related zone gets deleted.09:50
jtvPhew.10:01
jtvSo no deletefest then.10:01
rvbaNo.  But that seems to contradict what the doc says.10:04
jtvDidn't it do that only in some particular case where the Django-level schema implies that one kind of object is "contained" in another?10:05
jtvAnd to be honest, I'd be very very careful before making a framework set null on cascade as well!10:06
jtvrvba, do you remember what caused this error?  I'm getting it in the test suite now.10:08
jtvIntegrityError: duplicate key value violates unique constraint "auth_user_username_key"10:08
jtvDETAIL:  Key (username)=(test) already exists.10:08
rvbaLooks like test isolation violation.10:08
jtvArgh yes it does10:09
jtvAhh... the maasserver factory test was a MAASTestCase but should be a MAASServerTestCase.10:11
jtvToo many test-case classes!10:11
jtvOh, no, wait, there's something else...10:11
jtvMaybe it's this: Got an error creating the test database: database "test_maas" already exists10:12
=== CyberJacob is now known as CyberJacob|Away
=== freeflying is now known as freeflying_away
jtvQuiz time.  How can a test that starts with a @skip(...) cause well over a hundred failures in the test suite?12:45
jtvI would guess, by affecting ordering of the tests somehow and exposing a subtle bug somewhere else.  :(12:47
rvbaSounds nasty :/12:47
jtvFeels nasty.12:47
rvbaReviewer needed: https://code.launchpad.net/~rvb/maas/zone-placement/+merge/19854712:50
jtvWhat the hell, I'll give it a go...12:51
jtvrvba: I don't see any CSS fix in that branch...  Did some wires get crossed?  A change not committed/pushed?13:02
rvbajtv: the fix has been pushed, but the diff is not updating…13:02
jtvWeird.  There was no diff in the MP earlier, so I used "Download diff," and must have gotten the older version.13:03
rvbajtv: that's the commit in question: http://paste.ubuntu.com/6555915/13:04
jtvThanks.13:04
jtvrvba: review done.13:05
rvbaTa13:06
=== freeflying_away is now known as freeflying
jtvIt gets worse.  Just the @skip in front of my test is breaking all those tests.13:26
jtvrvba: if we strip None values out of a request, why does passing 'zone': None produce an error, while 'zone': '' acts as if you never passed a zone?13:40
rvbajtv: what's the error you're getting when you pass 'zone': None?13:42
jtvThe error said it was an invalid choice.13:42
jtvIt seems exactly the wrong way around.13:43
rvbaThe default choices includes the empty string.13:44
rvbaSo it validates fine, but is later considered the same as None.13:44
rvba'later' meaning later in the process.13:44
rvbaBut None gets rejected by the first validation step.13:45
jtvI don't suppose the same would happen if we tried to set another string field to the empty string...13:46
jtv...Because that just doesn't bear contemplating.13:46
jtvrvba: yup, can't clear agent_name either.  This could be bad.13:52
rvbajtv: given what agent_name is used for, it's fine.  But we ought the general problem.13:55
rvbaought to fix*13:55
jtvExactly.13:55
=== freeflying is now known as freeflying_away
=== freeflying_away is now known as freeflying
=== CyberJacob|Away is now known as CyberJacob
=== CyberJacob is now known as CyberJacob|Away

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!