Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix WMS harvest issue #514

Closed
2 of 8 tasks
minhd opened this issue Jun 1, 2017 · 3 comments
Closed
2 of 8 tasks

Fix WMS harvest issue #514

minhd opened this issue Jun 1, 2017 · 3 comments
Labels
Milestone

Comments

@minhd
Copy link
Contributor

minhd commented Jun 1, 2017

Description

The creation of service record from a WMS server fail when setting the pycsw:AnyText. The error returns is

[ERROR] file=/opt/pycsw/pycsw/ogc/csw/csw2.py line=1304 module=csw2 function=harvest 'module' object has no attribute 'get_anytext'

Upon closer inspection, the line that causes the error calls set(context, serviceobj, 'pycsw:AnyText', util.get_anytext(md.getServiceXML())) of which util.get_anytext is undefined.

A possible replacement of that would be

_set(
        context,
        serviceobj,
        'pycsw:AnyText',
        repository.get_anytext(md.getServiceXML())
    )

I have prepared a commit for it minhd@aa5d377 and can issue a PR anytime

Environment

  • operating system: alpine
  • Python version: 2.7
  • pycsw version:
  • source/distribution
    • git clone
    • DebianGIS/UbuntuGIS
    • PyPI
    • zip/tar.gz
    • other (please specify):
  • web server
    • Apache/mod_wsgi
    • CGI
    • other (please specify): Apache/mod_proxy docker

Steps to Reproduce

Issue a harvest request with the following payload

<?xml version="1.0" encoding="UTF-8"?>
<Harvest xmlns="http://www.opengis.net/cat/csw/2.0.2" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:ows="http://www.opengis.net/ows" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/" xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-publication.xsd" service="CSW" version="2.0.2">
  <Source>http://dapds00.nci.org.au/thredds/wms/fx3/gbr1/gbr1_simple_2016-03-30.nc</Source>
  <ResourceType>http://www.opengis.net/wms</ResourceType>
  <ResourceFormat>application/xml</ResourceFormat>
</Harvest>

@ricardogsilva
Copy link
Member

Hi @minhd
Thanks for reporting this. This problem comes from a recent refactoring of the pycsw.core.util module.

A PR would be welcome, thanks in advance.

I'll also check to see if there might be other references to this function elsewhere in the code.

@tomkralidis
Copy link
Member

@minhd thanks for the report. I echo @ricardogsilva's suggestion. Looks like we also need to make a fix in https://github.com/geopython/pycsw/blob/master/pycsw/plugins/repository/odc/odc.py#L61. Thanks in advance!

@minhd
Copy link
Contributor Author

minhd commented Jun 1, 2017

I've issued a PR #518

tomkralidis added a commit that referenced this issue Jun 2, 2017
@tomkralidis tomkralidis added the bug label Jun 2, 2017
@tomkralidis tomkralidis added this to the 2.2.0 milestone Jun 2, 2017
minhd added a commit to minhd/pycsw that referenced this issue Jun 6, 2017
* upstream/master:
  removed python 2.6 from the tox settings
  fix ref (geopython#514)
  Fixed harvesting WMS. calling undefined function (geopython#518)
  Issue 508 read pycsw config from env (geopython#509)
minhd added a commit to minhd/pycsw that referenced this issue Jun 9, 2017
* master:
  Do not silence exceptions on custom plugins (geopython#487) (geopython#527)
  decouple requirements files in lieu of assembling via tox config (geopython#521) (geopython#497)
  from mock import Mock as MagicMock
  codecov integration (geopython#525)
  fixed code review issues
  version is now stored on a single file, VERSION.txt
  removed python 2.6 from the tox settings
  fix ref (geopython#514)
  Fixed harvesting WMS. calling undefined function (geopython#518)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants