I am trying to show a diff in two files from a daily script.
i am unable to get it to read the files correctly and show what is different.
example of the files is -
<ad_xml>
<group name="group1">
</group>
<group name="group2">
<user>
<name>user1</name>
</user>
<user>
<name>user2</name>
</user>
<user>
<name>user3</name>
</user>
<user>
<name>user4</name>
</user>
<user>
<name>user5</name>
</user>
<user>
<name>user6</name>
</user>
<user>
<name>user7</name>
</user>
</group>
<group name="group3">
<user>
<name>user1</name>
</user>
<user>
<name>user2</name>
</user>
<user>
<name>user3</name>
</user>
<user>
<name>user4</name>
</user>
</group>
</ad_xml>
f1 = (line.strip() for line in open(oldfile, 'r'))
f2 = (line.strip() for line in open(filename, 'r'))
name = ('<name>%s</name>' % user)
for name in f2:
if name in f1:
pass
else:
print "New user: %s" % user
for name in f1:
if name in f2:
pass
else:
print "User removed: %s" % user