Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P10000
Use pypuppetdb to find apt files created without apt::repository
Active
Public
Actions
Authored by
jbond
on Dec 20 2019, 12:24 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Referenced Files
F31483929: raw.txt
Dec 20 2019, 12:24 PM
2019-12-20 12:24:57 (UTC+0)
Subscribers
None
#!/usr/bin/env python3
from
pypuppetdb
import
connect
from
pypuppetdb.QueryBuilder
import
RegexOperator
def
main
():
found_files
=
[]
db
=
connect
()
query_regex
=
RegexOperator
(
'title'
,
'^\/etc\/apt\/sources.list.d\/'
)
resources
=
db
.
resources
(
'file'
,
query
=
query_regex
)
for
resource
in
resources
:
if
resource
.
sourcefile
!=
'/etc/puppet/modules/apt/manifests/repository.pp'
:
print
(
resource
.
sourcefile
)
if
__name__
==
'__main__'
:
raise
SystemExit
(
main
())
Event Timeline
jbond
created this paste.
Dec 20 2019, 12:24 PM
2019-12-20 12:24:57 (UTC+0)
Log In to Comment