[02:38] <rawang> hello, anyone here?
[02:38] <rawang> while I run "maas-cli necadmin node-groups import-boot-images"
[02:38] <rawang> i 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_call
[02:38] <rawang>     raise CalledProcessError(retcode, cmd)
[02:38] <rawang> CalledProcessError: CalledProcessError("y", line 511, in check_call
[02:38] <rawang>     raise CalledProcessError(retcode, cmd)
[02:38] <rawang> CalledProcessError: CalledProcessError(
[02:46] <rawang> julianwa, hi
[02:55] <rawang> hello anyone?
[02:56] <julianwa> rawang: hi
[02:56] <rawang> julianwa, hi you didn't connect to the irc?
[02:57] <rawang> julianwa, just quick question, can you login the irc, i'll pm you
[02:57] <julianwa> rawang: I'm on it
[04:00] <rawang> hi guys, how do i know if maas-cli foo node-groups import-boot-images is finished or not?
[05:46] <rawang> hi guys, how do i know if maas-cli foo node-groups import-boot-images is finished or not?
[08:54] <jtv> rvba: can't add a zone!  The "Add zone" page just looks like the zones listing that I just came from.
[08:54] <rvba> jtv: yeah, I know, this is not implemented yet :)
[08:54] <jtv> Ah!  OK.  :)
[08:55] <jtv> I'll use the factory then.
[08:55] <jtv> (I added a factory method)
[08:55] <rvba> jtv: but the url exists, have a look in src/maasserver/urls.py
[08:55] <rvba> jtv: there is a factory method already
[08:55] <rvba> make_zone()
[08:56] <rvba> jtv: also, I added 2 zones to the sampledata, for convenience.
[08:57] <jtv> rvba: the HTML on the form is pretty weird actually!
[08:57] <rvba> Which form?  The "edit node" form?
[08:58] <jtv> The empty item reads: <option value selected="selected">---------</option>
[08:58] <jtv> Yes, the "edit node" form.
[08:58] <jtv> The zone dropdown, like you suggested.
[08:58] <jtv> Note how the "value" attribute has no value.
[08:58] <rvba> That's weird indeed.
[08:59] <jtv> It'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)
[09:00] <jtv> I'd better get into that middleware...
[09:00] <rvba> jtv: that's not what I see :)
[09:01] <rvba> <select id="id_zone" name="zone">
[09:01] <rvba> <option value="">---------</option>
[09:06] <jtv> rvba: different versions..?
[09:06] <jtv> I'm running django 1.5.4.
[09:07] <rvba> Same here.
[09:07] <rvba> jtv: I think I know where the pb is.
[09:08] <rvba> The node->zone ForeignKey has null=True.
[09:09] <jtv> Which sounded redundant to me, for a foreign key, but you're about to tell me that it means something unexpected, right?
[09:12] <jtv> Hmmno, no difference when I remove the null=True.
[09:13] <rvba> No, because we need to regenerate the migration.
[09:13] <jtv> !
[09:14] <jtv> Doesn't the form logic just use whatever it currently sees in that code?
[09:16] <jtv> rvba: oops, when I leave the blank=True in place but remove the null=True, South thinks the field becomes NOT NULL!
[09:16] <jtv> rvba: I tried setting DEBUG, but where does the POST body get logged?
[09:16] <rvba> jtv: which is all right, but we should also add default=''
[09:17] <jtv> Add it where?  For the model field definition we already have default=None
[09:17] <rvba> Which we should change to default=''
[09:17] <rvba> Now, South has a problem with that apparently.
[09:17] <rvba> jtv: in maas.log
[09:17] <jtv> WTF that worked
[09:18] <jtv> maas.log..?  This is a dev setup.
[09:18] <rvba> The appserver log then.
[09:19] <jtv> Removing null=True and passing default='' got me past South, but it doesn't get the tests passing.  :(
[09:20] <jtv> Ah, it said "nothing to migrate."
[09:20] <jtv> No, no, that was a different run.
[09:21] <jtv> I 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:24] <jtv> rvba: I wonder if I set the DEBUG option in the right way and place...  Not exactly clear.
[09:25] <jtv> Still no POST bodies in the webapp logs.
[09:26] <rvba> I removed null=True and passed default='' but now South errors when running the migration.
[09:26] <jtv> Not for me...  but it turns the database field into a text field!
[09:26] <jtv> Which is... probably not what we want.
[09:26] <rvba> It is what we want I think.
[09:26] <rvba> The foreignkey points to the name of the zone.
[09:27] <jtv> Ah
[09:27] <jtv> But 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:28] <rvba> Isn't there provision for an "empty default"?  At the db level I mean.
[09:28] <jtv> Yes, NULL.
[09:29] <jtv> SQL makes lots of sense.
[09:29] <rvba> Okay, so I guess we need to use that then.
[09:29] <jtv> Yes, it's definitely the appropriate choice from a database point of view.
[09:29] <jtv> But what's the appropriate choice from the form's point of view..!?
[09:31] <rvba> It probably means we have to re-defined the choices the form uses.
[09:31] <rvba> re-define*
[09:47] <rvba> jtv: I'd be curious to know how you interpret https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ForeignKey.on_delete
[09:50] <rvba> jtv: my testing shows that the node's zone field is set to None when the related zone gets deleted.
[10:01] <jtv> Phew.
[10:01] <jtv> So no deletefest then.
[10:04] <rvba> No.  But that seems to contradict what the doc says.
[10:05] <jtv> Didn'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:06] <jtv> And to be honest, I'd be very very careful before making a framework set null on cascade as well!
[10:08] <jtv> rvba, do you remember what caused this error?  I'm getting it in the test suite now.
[10:08] <jtv> IntegrityError: duplicate key value violates unique constraint "auth_user_username_key"
[10:08] <jtv> DETAIL:  Key (username)=(test) already exists.
[10:08] <rvba> Looks like test isolation violation.
[10:09] <jtv> Argh yes it does
[10:11] <jtv> Ahh... the maasserver factory test was a MAASTestCase but should be a MAASServerTestCase.
[10:11] <jtv> Too many test-case classes!
[10:11] <jtv> Oh, no, wait, there's something else...
[10:12] <jtv> Maybe it's this: Got an error creating the test database: database "test_maas" already exists
[12:45] <jtv> Quiz time.  How can a test that starts with a @skip(...) cause well over a hundred failures in the test suite?
[12:47] <jtv> I would guess, by affecting ordering of the tests somehow and exposing a subtle bug somewhere else.  :(
[12:47] <rvba> Sounds nasty :/
[12:47] <jtv> Feels nasty.
[12:50] <rvba> Reviewer needed: https://code.launchpad.net/~rvb/maas/zone-placement/+merge/198547
[12:51] <jtv> What the hell, I'll give it a go...
[13:02] <jtv> rvba: I don't see any CSS fix in that branch...  Did some wires get crossed?  A change not committed/pushed?
[13:02] <rvba> jtv: the fix has been pushed, but the diff is not updating…
[13:03] <jtv> Weird.  There was no diff in the MP earlier, so I used "Download diff," and must have gotten the older version.
[13:04] <rvba> jtv: that's the commit in question: http://paste.ubuntu.com/6555915/
[13:04] <jtv> Thanks.
[13:05] <jtv> rvba: review done.
[13:06] <rvba> Ta
[13:26] <jtv> It gets worse.  Just the @skip in front of my test is breaking all those tests.
[13:40] <jtv> rvba: 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:42] <rvba> jtv: what's the error you're getting when you pass 'zone': None?
[13:42] <jtv> The error said it was an invalid choice.
[13:43] <jtv> It seems exactly the wrong way around.
[13:44] <rvba> The default choices includes the empty string.
[13:44] <rvba> So it validates fine, but is later considered the same as None.
[13:44] <rvba> 'later' meaning later in the process.
[13:45] <rvba> But None gets rejected by the first validation step.
[13:46] <jtv> I 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:52] <jtv> rvba: yup, can't clear agent_name either.  This could be bad.
[13:55] <rvba> jtv: given what agent_name is used for, it's fine.  But we ought the general problem.
[13:55] <rvba> ought to fix*
[13:55] <jtv> Exactly.