Friday, 2021-10-29

francieGood morning gouthamr09:23
francieHello vkmc14:52
francieGood afternoon14:52
vkmchi francie!14:53
vkmcafternoon14:53
francieI needed your guide on the unit test14:53
francieI was searching for test_do_allow_access function but could not find14:53
francieDoes this mean it does not exist and I need to create one?14:54
francieReason: I do not want to duplicate?14:54
vkmcthat means that test doesn't exist14:54
vkmcbut let's analyze things a bit 14:55
francieokay14:55
francieI am listening14:56
vkmchave you tried the command you need to tweak?14:57
vkmcI mean, have you executed that?14:57
vkmcI don't remmeber if you have a development environment set up or not 14:57
francieWe tried to setup the dev environment but not completing14:58
vkmcok 14:58
francieI ran it again this morning but failed14:58
vkmcok ok 14:58
francielet me run it again14:58
vkmcdo you mind sharing a tmate with me?14:58
vkmchttps://tmate.io/14:59
francieOne moment14:59
vkmcok14:59
vkmcdeadline for application is next Friday14:59
vkmcthere is time to finish this 14:59
francie https://tmate.io/t/ro-ZCqc335CfZMJnkZSxcE5wywrL15:01
franciesure I know15:01
vkmccannot access it 15:02
vkmcdo you have the non-read only ssh link? 15:02
francienot at all15:12
vkmcso you have four links15:12
francieyes15:12
vkmcI need the ssh that is not read only 15:13
franciethis is the browser version15:13
vkmcyeah, I need the non browser15:13
franciessh ro-ZCqc335CfZMJnkZSxcE5wywrL@lon1.tmate.io15:13
vkmcthat's read only15:13
franciehmmm15:13
franciedo I have to recreate it15:13
franciebecuase I started running stack.sh already15:14
francie?15:14
vkmcok15:14
vkmcnevermind 15:14
vkmcjust let's the script continue 15:14
vkmcand we can see the error there15:14
francieokay15:15
vkmcso, in the meantime15:15
francieyeah15:15
vkmcwe can think about the issue you are fixing 15:15
franciesure15:15
vkmcbasically what we want to do is to add a flag, --wait, to the manila access-allow and access-deny operations 15:16
vkmcthose operations are there for grant access to the created shares15:16
vkmcso I say, manila access-allow my-test-share IP 10.10.10.1 15:16
vkmcwith that, I'm saying, that 10.10.10.1 has access to my share my-test-share 15:16
vkmctherefore I can mount the share from that IP 15:17
francieI get it now :)15:17
vkmcnot sure how familiar you are with those terms 15:18
vkmcbut, no need to worry about those right now 15:18
vkmcone thing to note, though, is that we have "resources" 15:18
vkmca share is a resource15:18
vkmca share snapshot is a resource15:18
vkmca share replica is a resource 15:18
franciemaking sense...15:18
vkmcbut, an access rule, is not represented as a resource in our abstraction15:18
vkmcso15:18
vkmcthe way we need to fix this is a bit different 15:19
vkmcthis is the function you are using 15:19
vkmchttps://github.com/openstack/python-manilaclient/blob/master/manilaclient/v2/shell.py#L3315:19
vkmcif we see the implementation of it 15:19
vkmcthis are the resources we are considering https://github.com/openstack/python-manilaclient/blob/master/manilaclient/v2/shell.py#L52-L6015:19
francieyeah15:20
vkmcperhaps this is not the easiest bug for you to fix 15:22
vkmcbecause of this detail 15:22
francieI am understanding it15:22
vkmcok, let's continue with it then 15:22
vkmcso15:22
francieyeah15:23
vkmcwhen I apply an access rule 15:23
vkmcthe output is as follows15:23
vkmchttps://paste.opendev.org/show/810282/15:23
vkmcthe status is... "queued_to_apply"15:23
vkmcand the prompt returns 15:24
francieokay15:24
vkmcbut it returns and we don't know if it was applied or not 15:24
francieok15:24
vkmcso, we would need to create a waiter function 15:24
vkmcthat polls the access rules 15:24
vkmcand when the access rule is successfully applied15:24
vkmcthen, it returns15:24
francieSo my patch just uses a decorator which does not apply here right?15:25
franciehttps://review.opendev.org/c/openstack/python-manilaclient/+/81515715:26
francieFrom the above, we need a _waiter function correct? or the decorator does the magic?15:27
vkmcso... it's not a decorator 15:27
vkmcit's an auxiliary function we are using to wrap the "wait for status" 15:27
vkmcindependently of the resource we are calling 15:27
vkmcwe need to extend that function to include access_rules 15:27
vkmcgoing through the code a bit, share access rules are represented as resources as well15:28
vkmchttps://github.com/openstack/python-manilaclient/blob/master/manilaclient/v2/share_access_rules.py15:28
vkmcso what we are missing, only, is the function to wait for the share access rule to be created15:28
vkmcso you would need to add a function like this 15:28
vkmchttps://github.com/openstack/python-manilaclient/blob/master/manilaclient/v2/shell.py#L246-L24815:28
vkmc_find_share_access_rule(cs, access_rule) 15:29
vkmcinclude that resource in the find_resource dict https://github.com/openstack/python-manilaclient/blob/master/manilaclient/v2/shell.py#L52-L6015:29
vkmcshare_access_rule: _find_share_access_rule 15:29
francieMaking sense...15:29
vkmcand then, change the resource type when you call wait_for_resource_status, to be "share_access_rule"15:30
vkmcthat's one thing we need to fix15:30
vkmcanother thing is that, I believe we won't need to add this for the access-deny operation15:30
vkmcsince the removal is immediate15:31
francieperfectlok15:31
vkmcand last but not least15:31
vkmcthe unit test 15:31
francieam listening..15:32
vkmcso this fix is in v2/shell.py15:33
vkmcso we need to add the unit test 15:33
vkmcunder15:33
vkmcv2/test_shell.py 15:33
vkmceach function has it test under the same path in the unit test structure 15:34
vkmcso we keep things clear and tidy 15:34
vkmchas it test or tests, because in several cases functions have more than a single unit test 15:34
vkmchttps://github.com/openstack/python-manilaclient/blob/master/manilaclient/tests/unit/v2/test_shell.py#L2183-L2195 <- this is the place we want to add this test 15:35
vkmcas you see, I marked " def test_allow_access_with_metadata(self): "15:36
vkmcthat's only a test case for test_allow_access15:36
vkmcthe case in which the end user pass metadata 15:36
vkmcthere are others15:36
vkmcin the same section of the test file 15:36
vkmcwe would need to add one like "test_allow_access_wait" 15:36
vkmcor something like that 15:36
francieyeah15:36
vkmcthat passes the --wait flag and we make sure that the waiter is being called15:36
vkmcand that should be good enough15:37
vkmcdoes this make sense?15:37
francieperfectly!15:37
francieThis is wonderful!15:37
vkmccool!15:37
francieThank you very much15:37
vkmcanytime 15:37
vkmcso there are three things you need to do 15:37
vkmc1. add share_access_rule resource to the wait_for_status function 15:38
francieok15:38
vkmc2. remove waiter for access-deny 15:38
vkmc3. add unit test 15:38
francieunderstood15:39
vkmclet me know if you hit any issue 15:39
francieLet me get to this asap15:39
francieThat is cool15:39
francieThank you very much for your time15:39
vkmcmaaritamm, hi, those are my conclusions about what it needs to be done for the access_allow/access_deny `15:39
francieThe stack is still running15:39
vkmc^15:39
vkmcfrancie, anytime, sorry I didn't reply sooner 15:40
vkmcfrancie, yes, is fine, I'm watching 15:40
francieNo worries15:40
francieCool!15:40
vkmc++15:46
maaritammvkmc, cool, thanks for digging into it! :)16:55

Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!