[Pulp-list] rpm copy between repos based on build_time

Brian Bouterse bbouters at redhat.com
Tue Jan 12 15:25:42 UTC 2016


Hi Radu,

I haven't tested this myself, but I suspect the value you are using for
build_time does not match up with how the database thinks of time. When
I look at an RPM in my pulp development database I see this snippet:

<snip>
"build_time" : 1331831373,
</snip>

I suspect that your criteria request is not matching because it is
expressed as "2015-08-01". I'm not sure what it needs to be.

-Brian


On 12/31/2015 11:07 AM, Radu Coroi wrote:
> Hi All,
> I'm trying to create a monthly snapshot release process with each new
> repo/snapshot having all the packages in Oracle Linux Latest repo until
> the beginning of the each month.
> 
> I tried to use the following json:
> { "source_repo_id" : "rc_test1",
>   "criteria": {
>     "type_ids" : ["rpm"],
>     "filters" : {
>       "unit" : { "build_time": {"$lte": "2015-08-01"}}
>     }
>   }
> }
> 
> And the following command:
>  curl -k -i -H "Accept: application/json" -X POST --data-binary
> "@/home/adm_RaduCoroi/ansible/pulp/copy_between_repos_based_on_build_time.json"
>  https://admin:admin@lab-a-pulp001.test-lab.local//pulp/api/v2/repositories/rc_test1/actions/associate/
> HTTP/1.1 202 ACCEPTED
> Date: Thu, 31 Dec 2015 15:31:46 GMT
> Server: Apache/2.2.15 (Oracle)
> Content-Length: 172
> Connection: close
> Content-Type: application/json; charset=utf-8
> 
> {"spawned_tasks": [{"_href":
> "/pulp/api/v2/tasks/8846ffdf-9d77-4fb5-93fa-ee417ab1bd05/", "task_id":
> "8846ffdf-9d77-4fb5-93fa-ee417ab1bd05"}], "result": null, "error": null}
> 
> Unfortunately nothing was copied between the test repos as build_time
> might not be part of the metadata.
> 
> I know that if I can create a schedule to get all rpms from the source
> to the destination but to go back in time without manual parsing of the
> RPM headers I will like to be able to filter based on build_time or
> similar info.
> 
> Thank you very much,
> Radu
> 
> 
> _______________________________________________
> Pulp-list mailing list
> Pulp-list at redhat.com
> https://www.redhat.com/mailman/listinfo/pulp-list
> 




More information about the Pulp-list mailing list