[openstack-dev] [oslo-incubator] rpc.cleanup method is not reachable due to wrong import of rpc module
Hi all, rpc module is not imported properly in nova, cinder, neutron projects. It is imported from wrong package. In oslo-incubator 'rpc' module is used in openstack/common/service.py file and it is present at openstack/common package. (https://github.com/openstack/oslo-incubator/blob/master/openstack/common/service.py#L48https://github.com/openstack/oslo-incubator/blob/master/openstack/common/service.py%23L48) But this 'rpc' module is present at base package in 'nova' and 'cinder' project while it is present at neutron/common/ package in neutron project. Nova : https://github.com/openstack/nova/blob/master/nova/rpc.py Cinder : https://github.com/openstack/cinder/blob/master/cinder/rpc.py Neutron : https://github.com/openstack/neutron/blob/master/neutron/common/rpc.py This openstack/common/service.py is synced form oslo-incubator in each project. Because of this if we make change in specific project then these changes will get removed after re-synced oslo-incubator code. The same thing happened in nova project. This patch (https://review.openstack.org/#/c/81833/https://review.openstack.org/%23/c/81833/) has merged into nova code, but it is overwritten after syncing oslo-incubator code. There is comment on this patch by 'Mark McLoughlin' regarding the same. I have filed bug for this issue in oslo : https://bugs.launchpad.net/oslo/+bug/1334661 And also I have pushed patch for same. But this patch will fail for 'Neutron' project. I think we have to try importing 'rpc' module from all possible places till it gets imported properly OR we need to change location of 'rpc' module in projects for uniformity. (ie to put 'rpc' module at some common place) Could you please give me your opinions on the same. Thanks, Abhijeet __ Disclaimer:This email and any attachments are sent in strictest confidence for the sole use of the addressee and may contain legally privileged, confidential, and proprietary data. If you are not the intended recipient, please advise the sender by replying promptly to this email and then delete and destroy this email and any attachments without any further use, copying or forwarding___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [oslo-incubator] rpc.cleanup method is not reachable due to wrong import of rpc module
On Aug 4, 2014, at 10:36 AM, Malawade, Abhijeet abhijeet.malaw...@nttdata.com wrote: Hi all, rpc module is not imported properly in nova, cinder, neutron projects. It is imported from wrong package. In oslo-incubator 'rpc' module is used in openstack/common/service.py file and it is present at openstack/common package. (https://github.com/openstack/oslo-incubator/blob/master/openstack/common/service.py#L48) But this 'rpc' module is present at base package in 'nova' and 'cinder' project while it is present at neutron/common/ package in neutron project. Nova : https://github.com/openstack/nova/blob/master/nova/rpc.py Cinder : https://github.com/openstack/cinder/blob/master/cinder/rpc.py Neutron : https://github.com/openstack/neutron/blob/master/neutron/common/rpc.py This openstack/common/service.py is synced form oslo-incubator in each project. Because of this if we make change in specific project then these changes will get removed after re-synced oslo-incubator code. The same thing happened in nova project. This patch (https://review.openstack.org/#/c/81833/) has merged into nova code, but it is overwritten after syncing oslo-incubator code. There is comment on this patch by 'Mark McLoughlin' regarding the same. I have filed bug for this issue in oslo : https://bugs.launchpad.net/oslo/+bug/1334661 And also I have pushed patch for same. But this patch will fail for 'Neutron' project. I think we have to try importing 'rpc' module from all possible places till it gets imported properly OR we need to change location of 'rpc' module in projects for uniformity. (ie to put 'rpc' module at some common place) Could you please give me your opinions on the same. As we move oslo modules out of the incubator and into libraries, we need to decouple them from the applications that are using them. In this case, we have a library trying to invoke a global method from an application module. Rather than having the library try to guess where that module or function is, we need to change the API of the service module in Oslo so that it takes an explicit argument for the thing it needs. For example, in this case ServiceLauncher should take an argument with a sequence of cleanup methods to be invoked on shutdown, and the application should pass rpc.cleanup in that list when it creates the ServiceLauncher. Doug Thanks, Abhijeet __ Disclaimer:This email and any attachments are sent in strictest confidence for the sole use of the addressee and may contain legally privileged, confidential, and proprietary data. If you are not the intended recipient, please advise the sender by replying promptly to this email and then delete and destroy this email and any attachments without any further use, copying or forwarding ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [oslo-incubator] rpc.cleanup method is not reachable due to wrong import of rpc module
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On 04/08/14 16:36, Malawade, Abhijeet wrote: Hi all, rpc module is not imported properly in nova, cinder, neutron projects. It is imported from wrong package. In oslo-incubator 'rpc' module is used in openstack/common/service.py file and it is present at openstack/common package. (https://github.com/openstack/oslo-incubator/blob/master/openstack/common/service.py#L48 https://github.com/openstack/oslo-incubator/blob/master/openstack/common/service.py%23L48) But this 'rpc' module is present at base package in 'nova' and 'cinder' project while it is present at neutron/common/ package in neutron project. Nova : https://github.com/openstack/nova/blob/master/nova/rpc.py Cinder : https://github.com/openstack/cinder/blob/master/cinder/rpc.py Neutron : https://github.com/openstack/neutron/blob/master/neutron/common/rpc.py This openstack/common/service.py is synced form oslo-incubator in each project. Because of this if we make change in specific project then these changes will get removed after re-synced oslo-incubator code. The same thing happened in nova project. This patch (https://review.openstack.org/#/c/81833/ https://review.openstack.org/%23/c/81833/) has merged into nova code, but it is overwritten after syncing oslo-incubator code. There is comment on this patch by 'Mark McLoughlin' regarding the same. I have filed bug for this issue in oslo : https://bugs.launchpad.net/oslo/+bug/1334661 And also I have pushed patch for same. But this patch will fail for 'Neutron' project. I think we have to try importing 'rpc' module from all possible places till it gets imported properly I wonder whether calling rpc.cleanup() is a part of any public documentation for service.py. Looks like the module makes assumptions about consuming projects that are incorrect. Why not leaving cleanup to consumers instead (perhaps by allowing consumers to optionally pass a cleanup method to Service.__init__() to call later in .wait(), if needed)? OR we need to change location of 'rpc' module in projects for uniformity. (ie to put 'rpc' module at some common place) Could you please give me your opinions on the same. Thanks, Abhijeet __ Disclaimer:This email and any attachments are sent in strictest confidence for the sole use of the addressee and may contain legally privileged, confidential, and proprietary data. If you are not the intended recipient, please advise the sender by replying promptly to this email and then delete and destroy this email and any attachments without any further use, copying or forwarding ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCgAGBQJT358IAAoJEC5aWaUY1u57bVgH/24jF0ocismtVCDlock67ytt XdBo/iiS2l6ohikIrJg1F9qbPfxMRG92i7aPyK6DbouKeb15cKB4efitUcqrPp7i 1GwZX+yuAKMc/IpzPIIi/gHmYxLHdMMt4+H+O0ULsnfMTg6LGJQrwGVeweBy1qW1 vCAV4HinhNCv07YSR7QLqyl862a4bM5KKtzJYOmsio6a9cu4gDRI2gDcj9pr9TYL tzUpOrOgm2DIHBE6PNSdP7hkvTe1NwM+tcV7FXOCE3gyGakWkvExxWrSLmOI05t6 UuFUeDQwpiLwODPR1sczuwQhBFm+v65Vhp+etvlp9PqAm27Hhr4S7UxOJP51N0k= =AXGE -END PGP SIGNATURE- ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev